[R] Odp: Dealing with NAs

Petr PIKAL petr.pikal at precheza.cz
Mon Dec 19 08:33:43 CET 2011


Hi

Without knowing details about mlogit and without any data from your side 
to check I guess that you shall put

na.omit or na.exclude instead of na.pass to na.action

Regards
Petr

> "Ville Iiskola" <ville.iiskola at uta.fi> 
> Odeslal: r-help-bounces at r-project.org
> 
> 18.12.2011 15:06
> 
> Komu
> 
> <r-help at r-project.org>
> 
> Kopie
> 
> Předmět
> 
> [R] Dealing with NAs
> 
> 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