Applies glm() to a multiply imputed data set
Arguments
- formula
a formula expression as for other regression models, of the form response ~ predictors. See the documentation of
lmandformulafor details.- family
The family of the glm model
- data
An object of type
mids, which stands for 'multiply imputed data set', typically created by functionmice().- ...
Additional parameters passed to
glm.
Value
An objects of class mira, which stands for 'multiply imputed
repeated analysis'. This object contains data$m distinct
glm.objects, plus some descriptive information.
Details
This function is included for backward compatibility with V1.0. The function
is superseded by with.mids.
References
Van Buuren, S., Groothuis-Oudshoorn, C.G.M. (2000) Multivariate Imputation by Chained Equations: MICE V1.0 User's manual. Leiden: TNO Quality of Life.
Examples
imp <- mice(nhanes)
#>
#> iter imp variable
#> 1 1 bmi hyp chl
#> 1 2 bmi hyp chl
#> 1 3 bmi hyp chl
#> 1 4 bmi hyp chl
#> 1 5 bmi hyp chl
#> 2 1 bmi hyp chl
#> 2 2 bmi hyp chl
#> 2 3 bmi hyp chl
#> 2 4 bmi hyp chl
#> 2 5 bmi hyp chl
#> 3 1 bmi hyp chl
#> 3 2 bmi hyp chl
#> 3 3 bmi hyp chl
#> 3 4 bmi hyp chl
#> 3 5 bmi hyp chl
#> 4 1 bmi hyp chl
#> 4 2 bmi hyp chl
#> 4 3 bmi hyp chl
#> 4 4 bmi hyp chl
#> 4 5 bmi hyp chl
#> 5 1 bmi hyp chl
#> 5 2 bmi hyp chl
#> 5 3 bmi hyp chl
#> 5 4 bmi hyp chl
#> 5 5 bmi hyp chl
# logistic regression on the imputed data
fit <- glm.mids((hyp == 2) ~ bmi + chl, data = imp, family = binomial)
#> Warning: Use with(imp, glm(yourmodel)).
fit
#> call :
#> glm.mids(formula = (hyp == 2) ~ bmi + chl, family = binomial,
#> data = imp)
#>
#> call1 :
#> mice(data = nhanes)
#>
#> nmis :
#> age bmi hyp chl
#> 0 9 8 10
#>
#> analyses :
#> [[1]]
#>
#> Call: glm(formula = formula, family = family, data = complete(data,
#> i))
#>
#> Coefficients:
#> (Intercept) bmi chl
#> -2.79401 -0.08036 0.01732
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 22 Residual
#> Null Deviance: 25.02
#> Residual Deviance: 22.9 AIC: 28.9
#>
#> [[2]]
#>
#> Call: glm(formula = formula, family = family, data = complete(data,
#> i))
#>
#> Coefficients:
#> (Intercept) bmi chl
#> -6.99697 0.01263 0.02634
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 22 Residual
#> Null Deviance: 25.02
#> Residual Deviance: 22.1 AIC: 28.1
#>
#> [[3]]
#>
#> Call: glm(formula = formula, family = family, data = complete(data,
#> i))
#>
#> Coefficients:
#> (Intercept) bmi chl
#> -3.00590 -0.11008 0.02377
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 22 Residual
#> Null Deviance: 27.55
#> Residual Deviance: 24.34 AIC: 30.34
#>
#> [[4]]
#>
#> Call: glm(formula = formula, family = family, data = complete(data,
#> i))
#>
#> Coefficients:
#> (Intercept) bmi chl
#> -3.20038 -0.10112 0.02276
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 22 Residual
#> Null Deviance: 25.02
#> Residual Deviance: 22.33 AIC: 28.33
#>
#> [[5]]
#>
#> Call: glm(formula = formula, family = family, data = complete(data,
#> i))
#>
#> Coefficients:
#> (Intercept) bmi chl
#> -4.504237 -0.004896 0.015573
#>
#> Degrees of Freedom: 24 Total (i.e. Null); 22 Residual
#> Null Deviance: 25.02
#> Residual Deviance: 23.86 AIC: 29.86
#>
#>
