Error using pool ( ) with imputed data when using mice in r

75 Views Asked by At

I'm quit new to R.

I would like to conduct a linear regression with my imputed data.

This is my imputation code (works fine):

imp <- mice(impu, predictorMatrix=pred, method=meth, m=10, seed = 1234)
imp$imp
imp_compl_all = complete(imp, "long")

I don't want to use the complete function, instead I want to work with all 10 imputations.

Therefore I use the pool ( ) function. However, the following error messages now appear, when using this code:

**# Fit linear model**
library(mice)

model1_coc_ger \<- with(imp_compl_all, lm(CocAmount \~ education, subset = Country == "Germany"))

pool.fit \<- pool(model1_coc_ger)

summary(pool.fit)

This error code occurs:

pool.fit <- pool(model1_coc_ger) Error: No tidy method for objects of class qr In addition: Warning messages: 1: In get.dfcom(object, dfcom) : Infinite sample size assumed. 2: 'tidy.numeric' is deprecated. See help("Deprecated") 3: 'tidy.numeric' is deprecated. See help("Deprecated") 4: 'tidy.numeric' is deprecated. See help("Deprecated") 5: 'tidy.numeric' is deprecated. See help("Deprecated") 6: 'tidy.numeric' is deprecated. See help("Deprecated") 7: 'tidy.numeric' is deprecated. See help("Deprecated")

For your information: All my variables are numeric or factor variables. I have already tested this. Of course, there are also missings in the imp_compl_all data set, as this is the data set with all imputations.

Thanks for helping!

0

There are 0 best solutions below