Since updating R to 4.0.0 and re-installing mice
it seems that the round()
function no longer works on mice output but yields an error message.
For example (using iris dataset):
library(missForest) # for the prodNA function
library(mice) # for the imputations
#Creating dataset with missing values (NAs)
iris.mis <- prodNA(iris, noNA = 0.1)
head(iris.mis)
#Imputation
imputed_data <- mice(data = iris.mis, m = 5, method = "pmm",
maxit = 50, seed = 500)
model <- with(data = imputed_data, lm(Sepal.Length ~ Sepal.Width))
round(summary(pool(model), conf.int = TRUE, exponentiate = TRUE), 2)
This yields the error message:
Error in Math.data.frame(list(term = 1:2, estimate = c(760.13466726231, : non-numeric variable(s) in data frame: term
Using summary(pool(model), conf.int = T, exponentiate = T)
works just fine.
Before updating R and mice I've never had issues with the round function in R.