R: Evaluate an expression in multiple imputed datasets

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

A list object of S3 class `mira`

### Author(s)

Karin Oudshoorn, Stef van Buuren 2009-2012

### References

van Buuren S and Groothuis-Oudshoorn K (2011). `mice`: Multivariate Imputation by Chained Equations in `R`. Journal of Statistical Software, 45(3), 1-67. https://www.jstatsoft.org/v45/i03/

### See Also

`mids`, `mira`, `pool`, `D1`, `D3`, `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 3.8.0 Index]