Imputing Missing values with MICE in R

r
mice

#1

Hi there,

I have a problem with my dataset. I want to impute missing data for categorial variables (Age, Gender) but receive an error message.
This is what I have done

str(Brave.ger)
Brave.ger$ID <- as.numeric(Brave.ger$ID)
Brave.ger$Publisher Category <- as.factor(Brave.ger$Publisher Category)
Brave.ger$Gender <- as.factor(Brave.ger$Gender)
Brave.ger$Age <- as.factor(Brave.ger$Age)
Brave.ger$Geography <- as.factor(Brave.ger$Geography)

Brave_test <- mice(Brave.ger, m=5, maxit = 50, method = ‘polyreg’, seed = 500)
summary(Brave_test)
complete(Brave_test,2)

error message:
unable to find an inherited method for function ‘complete’ for signature ‘“mids”, “numeric”’

Could you help me to find a solution? I uploaded the dataset for a better understanding.

Thanks in advance!Mappe3.xls.zip (17.5 KB)