I'm building an mlogit model in R. The model works fine but when I add one-hot encoded variables it gives me the "system is computationally singular" which usually comes when correlation is high but my variables are one-hot encoded So Idk how that can be an issue
This is the model definition:
#Multinomial Logistic Regression
Model1 <- mlogit(choice ~ 0 | Sex + Age.1+ Household.Income +Area+JobA+JobB+JobC+JobD+JobE , data = DFIDX)
summary(Model1)
If I remove the job columns then it works fine but adding them gives me error:
This is sample of my dataset (I'm not using all the columns):
EDITED:
The initial model works when I remove one column of one-hot-encoded variables. But this one doesn't work and shows another error:
#Mixed logit Model with random parameters
Model2 <- mlogit(choice ~ 0 | Sex + Age.1+ Household.Income +JobA+JobB , data = DFIDX,
rpar=c("Sex:2" = 'n', "Sex:3" = 'n',
"Age.1:2" = 'n', "Age.1:3" = 'n',
"Household.Income:2" = 'n', "Household.Income:3" = 'n' ,
"JobA:2" = 'n', "JobA:3" = 'n',
"JobB:2" = 'n', "JobB:3" = 'n' ) ,
R = 100 , panel = TRUE)
summary(Model2)
Note: JobC was removed as there was 3 categories for this model and 1 was removed as suggested.