Usage
matchit(formula, data, method = "nearest", distance = "logit",
distance.options = list(), discard = "none",
reestimate = FALSE, ...)
Arguments
formula
This argument takes the usual syntax of R formula,
treat ~ x1 + x2
, where treat
is a binary treatment
indicator and x1
and x2
are the pre-treatment
covariates. Both the treatment indicator and pre-treatment covariates
must be contained in the same data frame, which is specified as
data
(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.
data
This argument specifies the data frame containing the
variables called in formula
.
method
This argument specifies a matching method. Currently,
"exact"
(exact matching), "full"
(full matching),
"genetic"
(genetic matching), "nearest"
(nearest
neighbor matching), "optimal"
(optimal matching), and
"subclass"
(subclassification) are available. The default is
"nearest"
. Note that within each of these matching methods,
MatchIt 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 units 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 units may change the quantity of
interest being estimated. The options are: "none"
(default), which discards no units before matching,
"both"
, which discards all units (treated and control) that are
outside the support of the distance measure,
"control"
, which discards only control units outside the
support of the distance measure of the treated units, and
"treat"
, which discards only treated units outside the support
of the distance measure of the control units.
reestimate
This argument specifies whether the model for
distance measure should be re-estimated after units are
discarded. The input must be a logical value. The default is
FALSE
.
...
Additional arguments to be passed to a variety of matching
methods.