library(mice)
md.pattern(dat1)
temp<-mice(dat1, m = 5, seed = 101)
dat1 <- complete(temp, 2)
Error in UseMethod("complete_") :
no applicable method for 'complete_' applied to an object of class "mids"
Hi, I'm trying to impute missing values using mice
package.
But I got the above error message.
The first time I imputed missing data it worked, but when I tried again it didn't. I've tried a lot with different options (changing seed, deleting existing data or "temp" variable)
Sometimes it worked but other times it didn't. What is the problem and solution? Thanks in advance.
I think the problem here is that you should rather be using some other libraries in your program which have a function named "complete". Just typing "complete" in help menu gave me 2 other libraries (tidyr,RCurl) which have the function in the same name. As simon suggested, I tried using "mice::complete". It works for me.
Try this:
dat1<-mice::complete(temp,2)
mice 3.7.5
redefines the complete()
function as the S3 complete.mids()
method for the generic tidyr::complete()
.
Assuming that mice
is attached, you should no longer see no applicable method for 'complete_' applied to an object of class "mids"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With