Skip to main content
added 314 characters in body
Source Link
sriya
  • 23
  • 3

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. Sample size is 50. The three of them are of class:factor while the other predictor is in class numeric.

When I run model with ONLY 3 class factor predictors it works OK. But when I include numeric predictor along with the above three predictors it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

What could be the reason for this error? I searched for this and found several related posts online, but in this case multi-collinearity eg would not be the cause because the problem with numeric and factor variables.

Any help would be much appreciated.

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. Sample size is 50. The three of them are of class:factor while the other predictor is in class numeric.

When I run model with ONLY 3 class factor predictors it works OK. But when I include numeric predictor along with the above three predictors it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

What could be the reason for this error?

Any help would be much appreciated.

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. Sample size is 50. The three of them are of class:factor while the other predictor is in class numeric.

When I run model with ONLY 3 class factor predictors it works OK. But when I include numeric predictor along with the above three predictors it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

What could be the reason for this error? I searched for this and found several related posts online, but in this case multi-collinearity eg would not be the cause because the problem with numeric and factor variables.

Any help would be much appreciated.

deleted 416 characters in body
Source Link
sriya
  • 23
  • 3

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. Sample size is 50. The three of them are factorsof class:factor while the other predictor is in class numeric.I have two questions.

Question 1: When I run model with fourONLY 3 class factor predictors as describedit works OK. But when I include numeric predictor along with the above, three predictors it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

However, when it includes only three predictors of class factor only it runs.

Question 2: HowWhat could the marginal effects of explanatory variables be computed when there are factor predictors. I found the following way for numeric variables. But it does not workreason for class factor variables.this error?

z<-with (dat_long, data.frame(x1 = tapply(x1, index(mlogit_model)$alt,mean),x2=tapply(x2,index(mlogit_model)$alt,mean), x3=tapply(x3, index(mlogit_model)$alt,mean)))

effects(mlogit_model,covariate = "x1", data=z)

Any help would be much appreciated.

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. The three of them are factors while the other predictor is in class numeric.I have two questions.

Question 1: When I run model with four predictors as described above, it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

However, when it includes only three predictors of class factor only it runs.

Question 2: How could the marginal effects of explanatory variables be computed when there are factor predictors. I found the following way for numeric variables. But it does not work for class factor variables.

z<-with (dat_long, data.frame(x1 = tapply(x1, index(mlogit_model)$alt,mean),x2=tapply(x2,index(mlogit_model)$alt,mean), x3=tapply(x3, index(mlogit_model)$alt,mean)))

effects(mlogit_model,covariate = "x1", data=z)

Any help would be much appreciated.

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. Sample size is 50. The three of them are of class:factor while the other predictor is in class numeric.

When I run model with ONLY 3 class factor predictors it works OK. But when I include numeric predictor along with the above three predictors it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

What could be the reason for this error?

Any help would be much appreciated.

Post Closed as "Not suitable for this site" by Glen_b
Source Link
sriya
  • 23
  • 3

Multinomial logit model in R with class factor predictors

I am running multinomial logit model using mlogit in R. The model includes 3 alternatives as the dependent variable and 4 individual specific predictors. The three of them are factors while the other predictor is in class numeric.I have two questions.

Question 1: When I run model with four predictors as described above, it returns the following error in R.

mlogit_model<-mlogit(y ~ 1| x1+x2+x3+x4, data=dat_long, reflevel = "3")

Error in solve.default(H, g[!fixed]) : 
system is computationally singular: reciprocal condition number =   8.31637e-17

However, when it includes only three predictors of class factor only it runs.

Question 2: How could the marginal effects of explanatory variables be computed when there are factor predictors. I found the following way for numeric variables. But it does not work for class factor variables.

z<-with (dat_long, data.frame(x1 = tapply(x1, index(mlogit_model)$alt,mean),x2=tapply(x2,index(mlogit_model)$alt,mean), x3=tapply(x3, index(mlogit_model)$alt,mean)))

effects(mlogit_model,covariate = "x1", data=z)

Any help would be much appreciated.