fit_mult_impute_obs_outcome {basecamb}R Documentation

Fit a model on multiply imputed data using only observations with non-missing outcome(s)

Description

This function is a wrapper for fitting models with Hmisc::fit.mult.impute() on a multiply imputed dataset generated with mice::mice(). Cases with a missing outcome in the original dataset are removed from the mids object by using the "subset" argument in Hmisc::fit.mult.impute().

Usage

fit_mult_impute_obs_outcome(mids, formula, fitter, ...)

Arguments

mids

a mids object, i.e. the imputed dataset.

formula

a formula that describes the model to be fit. The outcome (y variable) in the formula will be used to remove missing cases.

fitter

a modeling function (not in quotes) that is compatible with Hmisc::fit.mult.impute().

...

additional arguments to Hmisc::fit.mult.impute().

Value

mod a fit.mult.impute object.

Author(s)

Till D. Best

Examples

# create an imputed dataset
imputed_data <- mice::mice(airquality)

fit_mult_impute_obs_outcome(mids = imputed_data, formula = Ozone ~ Solar.R + Wind, fitter = glm)


[Package basecamb version 1.1.5 Index]