Unable to impute missing values through MICE for categorical variables

r
missing_values

#1

I was using MICE package to impute missing values in categorical variables.

imputed_Data_cat<-mice(data.frame(total$Credit_History,total$Self_Employed,total$Dependents,total$Gender,total$Loan_Amount_Term), m=5, maxit = 5, method = 'logreg')
However it is showing the following error :
iter imp variable 1 1 total.Credit_History total.Self_Employed total.Dependents Error in factor(vec, c(0, 1), levels(y)) : invalid 'labels'; length 4 should be 1 or 2 In addition: Warning messages: 1: Type mismatch for variable total.Dependents Imputation method logreg is not for factors with three or more levels. 2: Type mismatch for variable total.Loan_Amount_Term Imputation method logreg is not for factors with three or more levels.

Which method should be chosen instead of logistic regression in this case for categorical variables with 3 or more levels?


#2

You can use method=‘polyreg’ in the imputation command. This method helps impute the values for the categorical variables with more than 2 levels. Using logistic regression might be the reason you are getting this error.


#3

Whether this method works best for smaller data sets [1000 records] with over 70 categorical variables and which has multiple levels ?