I am using library(mlogit) in R and I am stuck at the error message saying:
Error in solve.default(H, g[!fixed]) :
system is computationally singular: reciprocal condition number = 8.41187e-25
Using mlogit.data function I have made following structure.
x <- mlogit.data(choice = "choice", shape = "long", data, alt.var = "alt", chid.var = "chid", varying = 7:11)
> head(x, n=9)
chid choice x1 x2 x3 x4 y1 y2 y3 y4 y5 alt
1.1 1 FALSE 1 1 4 7 0.04407 2490.17 0 80.00 2.277 1
1.2 1 FALSE 1 1 4 7 0.06035 3300.83 0 239.00 2.421 2
1.3 1 FALSE 1 1 4 7 0.06757 4450.70 0 242.37 2.555 3
1.4 1 TRUE 1 1 4 7 0.08850 5840.50 0 423.79 2.712 4
1.5 1 FALSE 1 1 4 7 0.11074 13240.38 0 618.03 2.858 5
1.6 1 FALSE 1 1 4 7 0.11990 15630.13 0 921.17 2.972 6
1.7 1 FALSE 1 1 4 7 0.04715 7800.00 0 320.00 2.463 7
1.8 1 FALSE 1 1 4 7 0.04176 8373.70 0 450.00 2.539 8
1.9 1 FALSE 1 1 4 7 0.04576 12318.20 0 600.00 2.628 9
There are 9 choices and x1~x4 are individual specific variables, and y1~y5 are alternative specific variables. x1 is categorical variable which takes 1 or 2. x2 and x3 are integer variable, x4 is categorical variable taking 7 integervalues. y are all numeric variables but y2 and y3 are censored so 0 is observed. So in the above example person1 chooses alternative 4 and x1~x4 are all same as they are individual specific. I made a conditional multinomial logit formula like below.
And here's the problem. I think I made all the settings exactly same as in the mlogit package examples, but I keep getting this error message!
f <- mFormula(choice ~ y1 + y2 + y3 + y4 + y5 | x1 + x2 + x3 + x4)
m <- mlogit(f, data = x, shape = "long", choice = "choice", alt.var = "alt", chid.var = "chid")
Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = 8.41187e-25
I'm fairly new here, and I really don't know if I am asking in the right fashion. But I really need help, and I would appreciate if anyone can help me through this problem... Thank you!