Description Usage Arguments Details Value Author(s) References See Also Examples
The matchitmice()
function enables parametric models for causal inference to work better by selecting matched subsets of the control and treatment groups of imputed datasets of a mids
class object.
1 2 3 |
formula |
This argument takes the usual syntax of R formula, |
datasets |
This argument specifies the datasets containing the treatment indicator and matching covariates called in the |
approach |
This argument specifies a matching approach. Currently, |
method |
This argument specifies a matching method. Currently, |
distance |
This argument specifies the method used to estimate the distance measure. The default is logistic regression, |
distance.options |
This optional argument specifies the optional arguments that are passed to the model for estimating the distance measure. The input to this argument should be a list. |
discard |
This argument specifies whether to discard observations that fall outside some measure of support of the distance score before matching, and not allow them to be used at all in the matching procedure. Note that discarding observations may change the quantity of interest being estimated. The current options are |
reestimate |
This argument specifies whether the model for estimating the distance measure should be reestimated after observations are discarded. The input must be a logical value. The default is |
... |
Additional arguments to be passed to the matching method. |
The matching is done using the matchitmice(y ~ x1, ...)
command, where y
is the vector of treatment assignments and x1
represents the covariates to be used in the matching model. There are a number of matching options, detailed below. The default syntax is matchitmice(formula, datasets = NULL, method = "nearest", model = "logit", ratio = 1, caliper = 0, ...)
. Summaries of the results can be seen graphically using plot()
or numerically using summary()
functions. The print()
function also prints out the output.
This function returns an object of the mimids
(matched multiply imputed datasets) class, that includes matched subsets of the imputed datasets primarily passed to the function by the datasets
argument.
Farhad Pishgar
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
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/
1 2 3 4 5 6 7 8 9 10 | #Loading the 'dt.osa' dataset
data(dt.osa)
#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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.