I'm analysing data using mlogit. For a certain data.frames logit1
and logit2
, this works perfectly fine.
However, if I create a certain subset data.frame logit3
and conduct mlogit in the exact same way, it gives the following error:
"Error in solve.default(H, g[!fixed]) :
Lapack routine dgesv: system is exactly singular: U[3,3] = 0"
This is how my code looks like:
mylogit3 <- mlogit.data(logit3, shape="long", alt.var="alt", id.var="ID", choice="choice", sep=",")
mnl3 <- mlogit(choice ~ -1 + con +X11+X12+X21+X22+X31+X32+X41+X42+X51+X61+X62, data=mylogit3)
The only difference between logit1
and logit3
is that column X12 only contains 0's. Is this causing the problem, and how can I work around the error?