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?
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.
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 ofmy 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 guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.