Last chance! 50% off unlimited learning
Sale ends in
Performs a computation of each of imputed datasets in data.
# S3 method for mids
with(data, expr, ...)
An object of S3 class mira
An object of type mids
, which stands for 'multiply imputed
data set', typically created by a call to function mice()
.
An expression to evaluate for each imputed data set. Formula's containing a dot (notation for "all other variables") do not work.
Not used
Karin Oudshoorn, Stef van Buuren 2009, 2012, 2020
van Buuren S and Groothuis-Oudshoorn K (2011). mice
:
Multivariate Imputation by Chained Equations in R
. Journal of
Statistical Software, 45(3), 1-67.
tools:::Rd_expr_doi("10.18637/jss.v045.i03")
mids
, mira
, pool
,
D1
, D3
, pool.r.squared
imp <- mice(nhanes2, m = 2, print = FALSE, seed = 14221)
# descriptive statistics
getfit(with(imp, table(hyp, age)))
# model fitting and testing
fit1 <- with(imp, lm(bmi ~ age + hyp + chl))
fit2 <- with(imp, glm(hyp ~ age + chl, family = binomial))
fit3 <- with(imp, anova(lm(bmi ~ age + chl)))
Run the code above in your browser using DataLab