Learn R Programming

MatchThem (version 0.8.1)

matchthem.data: Outputs Matched Imputed Datasets

Description

The matchthem.data() function extracts matching data from an object of the mimids class.

Usage

matchthem.data(object, n = 1)

Arguments

object

This argument specifies an object of the mimids class.

n

This argument specifies the matched imputed dataset number, intended to extract its matching data. The input must be a positive integer. The default is 1.

Value

This function returns a subset of the imputed dataset after matching with just the matched observations from control and treatment groups.

Details

The matched datasets within the mimids class object are extracted.

References

Daniel Ho, Kosuke Imai, Gary King, and Elizabeth Stuart (2007). Matching as Nonparametric Preprocessing for Reducing Model Dependence in Parametric Causal Inference. Political Analysis, 15(3): 199-236. http://gking.harvard.edu/files/abs/matchp-abs.shtml

See Also

mimids

Examples

Run this code
# NOT RUN {
#Loading the dataset
data(osteoarthritis)

#Multiply imputing the missing values
imputed.datasets <- mice(osteoarthritis, m = 5, maxit = 10,
                         method = c("", "", "mean", "polyreg", "logreg", "logreg", "logreg"))

#Matching the multiply imputed datasets
matched.datasets <- matchthem(OSP ~ AGE + SEX + BMI + RAC + SMK, imputed.datasets,
                              approach = 'within', method = 'nearest')

#Extracting the first imputed dataset
matched.dataset.1 <- matchthem.data(matched.datasets, n = 1)
# }

Run the code above in your browser using DataLab