Search code examples
rlogistic-regressionmultinomial

"system is computationally singular" error in mlogit R-package


I wanna solve my problem using multinomial logistic regression, mlogit R-package.

when I run the below code,

ml.data <- mlogit.data(dat, shape = "wide", choice = "Resp")
mlogit(Resp ~ A + B+ C+ D, ml.data)

I am getting this error: "system is computationally singular". I saw this post, but it does not help. I appreciated if anyone could help me.


Solution

  • mlogit doesn't follow the same model command-line formulas as other models.

    Try

    mlogit(Resp ~ 1|A+B+C+D , ml.data)
    

    and compare to

    multinom(Resp ~ A+B+C+D , dat)
    

    in package nnet. Also, check out ?mFormula and this answer