Matches Multiply Imputed Datasets
matchthem()
performs matching in the supplied imputed datasets, given as mids
or amelia
objects, by running MatchIt::matchit()
on each of the imputed datasets with the supplied arguments.
matchthem( formula, datasets, approach = "within", method = "nearest", distance = "glm", link = "logit", distance.options = list(), discard = "none", reestimate = FALSE, ... )
formula |
A |
datasets |
This argument specifies the datasets containing the exposure indicator and the potential confounders called in the |
approach |
The approach used to combine information across imputed datasets. Currently, |
method |
This argument specifies a matching method. Currently, |
distance |
The method used to estimate the distance measure (e.g., propensity scores) used in matching, if any. Only options that specify a method of estimating propensity scores (i.e., not |
link, distance.options, discard, reestimate |
Arguments passed to |
... |
Additional arguments passed to |
If an amelia
object is supplied to datasets
, it will first be transformed into a mids
object for further use. matchthem()
works by calling mice::complete()
on the mids
object to extract a complete dataset, and then calls MatchIt::matchit()
on each one, storing the output of each matchit()
call and the mids
in the output. All arguments supplied to matchthem()
except datasets
and approach
are passed directly to matchit()
. With the across method, the estimated propensity scores are averaged across imputations and re-supplied to another set of calls to matchit()
.
An object of the mimids
(matched multiply imputed datasets) class, which includes the supplied mids
object (or an amelia
object transformed into a mids
object if supplied) and the output of the calls to matchit()
on each imputed dataset.
Farhad Pishgar and Noah Greifer
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. https://gking.harvard.edu/files/abs/matchp-abs.shtml
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/v045/i03/
Gary King, James Honaker, Anne Joseph, and Kenneth Scheve (2001). Analyzing Incomplete Political Science Data: An Alternative Algorithm for Multiple Imputation. American Political Science Review, 95: 49–69. https://gking.harvard.edu/files/abs/evil-abs.shtml
#1 #Loading libraries library(MatchThem) #Loading the dataset data(osteoarthritis) #Multiply imputing the missing values imputed.datasets <- mice::mice(osteoarthritis, m = 5) #Matching the multiply imputed datasets matched.datasets <- matchthem(OSP ~ AGE + SEX + BMI + RAC + SMK, imputed.datasets, approach = 'within', method = 'nearest') #2 #Loading libraries library(Amelia) library(MatchThem) #Loading the dataset data(osteoarthritis) #Multiply imputing the missing values imputed.datasets <- amelia(osteoarthritis, m = 5, noms = c("SEX", "RAC", "SMK", "OSP", "KOA")) #Matching the multiply imputed datasets matched.datasets <- matchthem(OSP ~ AGE + SEX + BMI + RAC + SMK, imputed.datasets, approach = 'across', method = 'nearest')
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.