[R] Dealing with NAs

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sun Dec 18 17:27:08 CET 2011


Read the posting guide. An example is not reproducible without sample data.

You may need to remove data records containing NA. It may not even be a true NA, depending how you got your data into R.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Ville Iiskola <ville.iiskola at uta.fi> wrote:

>Hi
>
>I am trying to estimate parameter values with mlogit. I attach a part
>of my data.
>
>My code is
>
>x=mlogit.data(y,choice="voittaja",shape="long",id.var="id",alt.var="numero")
>
>summary(mlogit(voittaja  ~ Ie-1 , data=x, na.action=na.pass))
>
>
>
>But i get 
>
>
>
>Error in if (abs(x - oldx) < ftol) { : 
>  missing value where TRUE/FALSE needed
>
>
>Because there is Na in D2. 
>
>What should i do to make it work?
>
>
>
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list