[R] Error “system is exactly singular: U[6,6] = 0” when doing nested logit using mlogit package in R

Dera derawang at udel.edu
Tue Jul 28 00:01:54 CEST 2015


 have a problem about doing nested logit using mlogit package in R.

We did a survey about asking people to choose from different insurance
policies. To be specific, respondents were asked “Would you buy Policy A,
Policy B, or neither?" (Each choice is defined by the deductible and premium
associated with them)

Here is a brief example of our data named "mydata":

RespondentID    Choice    alt      Deductible     Premium
      1         False    PolicyA      500           1000
      1         TRUE     PolicyB     1000            500
      1         False    Neither       0              0
      2         TRUE     PolicyA      250           5000
      2         False    PolicyB      500            500
      2         False    Neither       0              0
      3         TRUE     PolicyA      500           2000
      3         False    PolicyB     5000           1000
      3         False    Neither       0              0
...

I'd like to use nested logit here, because "Policy A" and "Policy B" are
much similar than "Neither". So I tried to use the code to fit a nested
logit model:

nl.1 <- mlogit (Choice~Deductible+Premium, mydata,shape='long', choice =
'Choice', 
         nests=list(buy=c('PolicyA','PolicyA'), no='Neither'), alt.var =
"alt")
But it always gave the error warning:

Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is
exactly singular: U[6,6] = 0

If I do like this:

nl.2 <- mlogit (Choice~Deductible+Premium, mydata,shape='long', choice =
'Choice', 
         nests=list(buy=c('PolicyA','PolicyA'), no='Neither'), alt.var =
"alt", un.nest.el = TRUE)
It works. But I don't think the two nests I mention above have unique
elasticity, what "un.nest.el = TRUE" means.

Does anyone know about this? How can I avoid the error in the first code?

Thank you!



--
View this message in context: http://r.789695.n4.nabble.com/Error-system-is-exactly-singular-U-6-6-0-when-doing-nested-logit-using-mlogit-package-in-R-tp4710437.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list