0
for(i in 1:ncol(mldata))
{
  mlogit.mydata=mlogit(severity ~ 1|mldata[,i],data=mldata)
  mlogit[i]=summary(mlogit.mydata)$lratio$p.value
}

It gives the the following error: Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is exactly singular: U[57,57] = 0

Maninder Kaur
  • 53
  • 1
  • 1
  • 3

1 Answers1

0

Please add mldata details. And first argument of mlogit should be of type formula. Try the following code

for(i in 1:ncol(mldata))
   {
      formula <- as.formula(paste0("y ~ 1 | ", colnames(mldata)[i])
      mlogit.mydata=mlogit(formula,data=mldata)
      mlogit[i]=summary(mlogit.mydata)$lratio$p.value
   }
David Buck
  • 3,752
  • 35
  • 31
  • 35
Yashwanth
  • 69
  • 7