Calling the function "factorplot" for one categorial predictor variable (= multiple regressors in the model) in a multinomial model as shown in the second example (variable="education") results in an error. I encountered this using my own dataset but replicated the error using your example.
This is the error:
Error in names(b) <- obj$lev :
'names' attribute [4] must be the same length as the vector [1]
In addition: Warning message:
In cbind(0, v) :
number of rows of result is not a multiple of vector length (arg 1)
Code leading to error:
data("Chile", package="carData")
View(Chile)
library(nnet)
mod <- multinom(vote ~ age + sex + education, data=Chile)
f <- factorplot(mod, variable="education")
plot(f)
data("Chile", package="carData")
library(nnet)
mod <- multinom(vote ~ age + sex + education, data=Chile)
f <- factorplot(mod, variable="education")
plot(f)
Calling the function "factorplot" for one categorial predictor variable (= multiple regressors in the model) in a multinomial model as shown in the second example (variable="education") results in an error. I encountered this using my own dataset but replicated the error using your example.
This is the error:
Code leading to error:
Thank you!