weightitmice: Weights Multiply Imputed Datasets

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

Description

The weightitmice() function enables parametric models for causal inference to work better by estimating inverse propensity score weights of the control and treatment observations of each imputed dataset of a mids class object.

Usage

1
2
3
weightitmice(formula, datasets, approach = "within",
  method = "nearest", distance = "logit", distance.options = list(),
  discard = "none", reestimate = FALSE, ...)

Arguments

formula

This argument takes the usual syntax of R formula, y ~ x1 + x2, where y is a binary treatment indicator and x1 and x2 are the matching covariates. Both the treatment indicator and matching covariates must be contained in the imputed datasets, which are specified as datasets (see below). All of the usual R syntax for formula works. For example, x1:x2 represents the first order interaction term between x1 and x2 and I(x1^2) represents the square term of x1. See help(formula) for details.

datasets

This argument specifies the datasets containing the treatment indicator and matching covariates called in the formula. This argument must be an object of the mids class, which is typically produced by a previous call to mice() or mice.mids() functions from the mice package.

approach

This argument specifies a matching approach. Currently, "within" (calculating distance measures and matching based on them within each imputed dataset) and "across" (calculating distance measures within each imputed dataset, averaging distance measure for each observation across imputed datasets, and matching based on the averaged measures in each imputed dataset) approaches are available. The default is "within".

method

This argument specifies a matching method. Currently, only "nearest" (nearest neighbor matching) method is available. The default is "nearest". Note that within "nearest" method, MatchIt.mice offers a variety of options.

distance

This argument specifies the method used to estimate the distance measure. The default is logistic regression, "logit". A variety of other methods are available.

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 "none" (discarding no observations before matching), "both" (discarding all observations, both the control and treatment observations, that are outside the support of the distance measure), "control" (discarding only control observations outside the support of the distance measure of the treatment observations), and "treat" (discarding only treatment obsrvations outside the support of the distance measure of the control observations). The default is "none".

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 FALSE.

...

Additional arguments to be passed to the matching method.

Details

The weighting is done using the weightitmice(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 weightitmice(formula, datasets = NULL, method = "nearest", model = "logit", ...). Summaries of the results can be seen graphically using plot() or numerically using summary() functions. The print() function also prints out the output.

Value

This function returns an object of the wimids (weighted multiply imputed datasets) class, that includes inverse propensity score weights of observations of the imputed datasets (listed as the inverse.weights variables in each) primarily passed to the function by the datasets argument.

Author(s)

Farhad Pishgar

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

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

wimids

with

pool

Examples

 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"))

#Weighting the imputed datasets, 'datasets'
weighteddatasets <- weightitmice(KOA ~ SEX + AGE + SMK, datasets,
                                 approach = 'within', method = 'nearest')

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