Encountered Error during Imputation by mice package



Hi All,

As explained in one of the analyticsvidhya page to impute missing values by MICE package,I tried similar steps but getting some error.


#imputing missing value

imputed_Data <- mice(train.im, m=5, maxit = 50, method = ‘pmm’, seed = 100)

#get complete data ( 2nd out of 5)
completeData <- complete(imputed_Data,2)

And below is the error i m getting

Error in (function (classes, fdef, mtable) : **
** unable to find an inherited method for function ‘complete’ for signature ‘“mids”’

Can someone help ?


Hi, Did you check your imputed_Data ? Trying checking it once. It seems to me like…imputed_Data has a problem.
If everything is right, I would like you to reproduce the error with first imputed dataset rather than the second.
Paste your output here along with the training file.




Thanks for reaching out…i figured out where the mistake was…the had run this code before so i believe the imputed_data was there in the system so the code was throwing error after i changed the dataset name it run fine.