pool: Combines Estimates by Rubin’s Rules

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The pool() function combines the estimates from n repeated complete data analyses. The typical sequence of steps to do a matching procedure or estimating weights of observations of the imputed datasets are:

  1. Impute the missing data points by the mice function (from the mice package), resulting in a multiple imputed dataset (an object of the mids class);

  2. Match each imputed dataset using a matching model by the matchitmice() function, resulting in an object of the mimids class or estimate weights of observations in the imputed datasets by the weightitmice() function, resulting in an object of the wimids class;

  3. Fit the model of interest (scientific model) on each matched or weighted dataset by the with() function, resulting in an object of the mira class;

  4. Pool the estimates from each model into a single set of estimates and standard errors, resulting in an object of the mipo class.

Usage

1
pool(object, dfcom = NULL)

Arguments

object

This argument specifies an object of the mira class (produced by a previous call to with() function) or a list with model fits.

dfcom

This argument specifies a positive number representing the degrees of freedom in the complete data analysis. The default is NULL, which means to extract this information from the first fitted model or the fitted model with the lowest number of observations (when that fails the warning Large sample assumed is printed and the parameter is set to 999999).

Details

The pool() function averages the estimates of the complete data model and computes the total variance over the repeated analyses by the Rubin’s rules.

Value

This function returns an object of the mipo class (multiple imputation pooled outcome).

Author(s)

Extracted from the mice package written by Stef van Buuren et al. with few changes

References

Stef van Buuren and Karin Groothuis-Oudshoorn (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

with

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Loading the 'dt.osa' and 'dt.osp' datasets
data(dt.osa)
data(dt.osp)

#Imputing missing data points in the'dt.osa' dataset
datasets <- mice(dt.osa, m = 5, maxit = 1,
                 method = c("", "", "mean", "", "polyreg", "logreg", "logreg"))

#Matching the imputed datasets, 'datasets'
matcheddatasets <- matchitmice(KOA ~ SEX + AGE + SMK, datasets,
                               approach = 'within', method = 'exact')

#Merging the dataframe, 'dt.osp', with each imputed dataset of the 'matcheddatasets' object
matcheddatasets <- mergeitmice(matcheddatasets, dt.osp, by = "IDN")

#Analyzing the imputed datasets
models <- with(data = matcheddatasets,
               exp = glm(KOA ~ PTH,
                         na.action = na.omit, family = binomial))

#Printing pooled results
results <- pool(models)

MatchIt.mice documentation built on Aug. 28, 2019, 1:03 a.m.