在“ mlogit.data”上应用“ mlogit”功能时,如何解决“提供的行名长度错误”?

时间:2019-05-19 01:38:37

标签: r mlogit

我有这个:

mldata <- mlogit.data(mydata,cvar=c(type=5,fuel=11,price=17,range=23,acc=29,speed=35,
                             pollution=41,size=47,space=53,cost=59,station=65),
               shape="wide",choice="choice")

当我尝试申请时:

mlogit.model1 <- mlogit(choice~1|college+hsg2+coml5,data=mldata)

我收到此错误:

Error in data.frame(lapply(index, function(x) x[drop = TRUE]), row.names = rownames(mydata)) : 
  row names supplied are of the wrong length

0 个答案:

没有答案