with.mids {mice}R Documentation

Evaluate an expression in multiple imputed datasets

Description

Performs a computation of each of imputed datasets in data.

Usage

## S3 method for class 'mids':
with(data, expr, ...)

Arguments

data An object of type mids, which stands for 'multiply imputed data set', typically created by a call to function mice().
expr An expression with a formula object, with the response on the left of a ~ operator, and the terms, separated by + operators, on the right. See the documentation of lm and formula for details.
... Additional parameters passed to expr

Value

call The call that created the object.
call1 The call that created the mids object that was used in call.
nmis An array containing the number of missing observations per column.
analyses A list of m components containing the individual fit objects from each of the m complete data analyses.
formula The formula of the call that created the object.

Author(s)

Karin Oudshoorn, 2009

References

Van Buuren, S., Groothuis-Oudshoorn, K. (2009) MICE: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, forthcoming. http://www.stefvanbuuren.nl/publications/MICE in R - Draft.pdf

See Also

lm.mids, glm.mids, mids, mira, pool, pool.compare, pool.r.squared

Examples


imp <- mice(nhanes2)
fit1 <- with(data=imp,exp=lm(bmi~age+hyp+chl))
fit2 <- with(data=imp,exp=glm(hyp~age+bmi+chl,family=binomial))
anova.imp <- with(data=imp,exp=anova(lm(bmi~age+hyp+chl)))

[Package mice version 2.2 Index]