Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pool

Pools Estimates by Rubin's Rules


Description

pool() pools estimates from the ana;yses done withi neach imputed dataset. The typical sequence of steps to do a matching procedure on the imputed datasets are:

  1. Impute the missing values using the mice() function (from the mice package) or the amelia() function (from the Amelia package), resulting in a multiple imputed dataset (an object of the mids or amelia class);

  2. Match or weight each imputed dataset using matchthem() or weightthem(), resulting in an object of the mimids or wimids class;

  3. Check the extent of balance of covariates across the matched datasets (using functions in cobalt);

  4. Fit the statistical model of interest on each matched dataset by the with() function, resulting in an object of the mimira class; and

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

Usage

pool(object, dfcom = NULL)

Arguments

object

An object of the mimira class (produced by a previous call to with()).

dfcom

A positive number representing the degrees of freedom in the data analysis. The default is NULL, which means to extract this information from the fitted model with the lowest number of observations or the first fitted model (when that fails the parameter is set to 999999).

Details

pool() function averages the estimates of the model and computes the total variance over the repeated analyses by Rubin’s rules. It calls mice::pool() after computing the model degrees of freedom.

Value

This function returns an object of the mipo class. Methods for mipo objects (e.g., print(), summary, etc.) are available in mice, which does not need to be attached to use them.

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

Examples

#Loading libraries
library(MatchThem)
library(survey)

#Loading the dataset
data(osteoarthritis)

#Multiply imputing the missing values
imputed.datasets <- mice::mice(osteoarthritis, m = 5)

#Weighting the multiply imputed datasets
weighted.datasets <- weightthem(OSP ~ AGE + SEX + BMI + RAC + SMK,
                                imputed.datasets,
                                approach = 'within',
                                method = 'ps')

#Analyzing the weighted datasets
models <- with(weighted.datasets,
               svyglm(KOA ~ OSP, family = quasibinomial))

#Pooling results obtained from analyzing the datasets
results <- pool(models)
summary(results)

MatchThem

Matching and Weighting Multiply Imputed Datasets

v1.0.0
GPL (>= 2)
Authors
Farhad Pishgar [aut, cre], Noah Greifer [aut], Clémence Leyrat [ctb], Elizabeth Stuart [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.