[英]Error in mlogit package: system is computationally singular: reciprocal condition number = 8.87901e-37
I have a data set that is formatted according to mlogit's standards using mlogit.data command in Rstudio. 我有一个数据集,该数据集使用Rstudio中的mlogit.data命令根据mlogit的标准进行了格式化。
Trip SevereEarthquake Night Age Mode
1.NTG 1 0 0 18 FALSE
1.TGNV 1 0 0 18 FALSE
1.TGV 1 0 0 18 TRUE
After some variable creation which I do not include here to make the question short, I ran a multinomial logit model using the code below and it worked fine. 在创建了一些变量之后(我在这里未将其简化),我使用下面的代码运行了一个多项式logit模型,它运行良好。
mlogit(Mode ~ SE.TGV + SE.TGNV + AGE.NTG, data, reflevel = "NTG")
However when I define nests in the code (as below) to do a nested logit model I get an error: 但是,当我在代码中定义嵌套(如下所示)以进行嵌套的logit模型时,出现错误:
mlogit(Mode ~ SE.TGV + SE.TGNV + AGE.NTG, data, reflevel = "NTG",
nests = list(notrip = "NTG", trip = c("TGV","TGNV")))
Error in solve.default(crossprod(attr(x, "gradi")[, !fixed])) : system is computationally singular: reciprocal condition number = 8.87901e-37
resolve.default(crossprod(attr(x,“ gradi”)[,!fixed]))中的错误:系统在计算上是单数的:倒数条件数= 8.87901e-37
What is causing this problem? 是什么导致此问题? How can I solve this?
我该如何解决?
Error messages involving 'computationally singular' will arise if two of your variables are ,within tolerance, collinear ie are expressing the same thing. 如果您的两个变量在公差范围内,共线(即表示同一事物),则将出现涉及“计算单数”的错误消息。 This suggests you need to examine how the nested variables relate to one another and how they relate to the other variables via some correlation checks.
这建议您需要通过一些相关性检查来检查嵌套变量之间的关系以及它们与其他变量的关系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.