Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

singularity issue in mlogit model when model contains interaction

$
0
0

I'm using below r command on my choice model data which is perfectly working:

  • mlmodel_BL <- mlogit(choice ~ Price + Feature + Brloy , data = mldata_BL, reflevel = "Brand4")

but when I want to add interaction there, I face singularity error.

  • mlmodel_BL2 <- mlogit(choice ~ Price + Feature + Brloy + Income*Price , data = mldata_BL, reflevel = "Brand4")

error:

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

I tried below command and it worked, however, I prefer to include interaction form in my model instead of changing my data:

  • mldata_BL$Price_Income <- mldata_BL$Price * mldata_BL$Income

  • mlmodel_BL2 <- mlogit(choice ~ Price + Feature + Brloy + Price_Income , data = mldata_BL, reflevel = "Brand4")

would you please guide me on what might cause this issue in my code? thanks


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>