matchit
is the main command of the package
MatchIt, which enables parametric models for causal inference to
work better by selecting well-matched subsets of the original treated
and control groups. MatchIt implements the suggestions of Ho, Imai,
King, and Stuart (2004) for improving parametric statistical models by
preprocessing data with nonparametric matching methods. MatchIt
implements a wide range of sophisticated matching methods, making it
possible to greatly reduce the dependence of causal inferences on
hard-to-justify, but commonly made, statistical modeling assumptions.
The software also easily fits into existing research practices since,
after preprocessing with MatchIt, researchers can use whatever
parametric model they would have used without MatchIt, but produce
inferences with substantially more robustness and less sensitivity to
modeling assumptions. Matched data sets created by MatchIt can be
entered easily in Zelig (help.matchit
.matchit(formula, data, method = "nearest", distance = "logit",
distance.options = list(), discard = "none",
reestimate = FALSE, ...)
treat ~ x1 + x2
, where treat
is a binary treatment
indicator and x1
and x2
are the pre-treatment
covariates. Both the treatment indicator anformula
."exact"
(exact matching), "full"
(full matching),
"genetic"
(genetic matching), "nearest"
(nearest
neighbor matching), "optimal"
"logit"
. A variety of other methods are available. See
FALSE
.matchit
call.summary(m.out$model)
will give the
summary of the model where m.out
is the output object from
matchit
.ratio
matrix
where the row names, which can be obtained through
row.names(match.matrix)
, represent the names of the
treatment units, which come from the data frame specified in
data
. Each column stores the name(s) of the control unit(s) matched
to the treatment unit of that row. For example, when the
ratio
input for nearest neighbor or optimal matching is
specified as 3, the three columns of
match.matrix
represent the three control units matched to
one treatment unit).
NA
indicates that the treatment unit was not matched.TRUE
if unit $i$ was
discarded, and it is set to FALSE
otherwise.0
. Matched treated units have
weight 1
. Each matched control unit has weight proportional
to the number of treatment units to which it was matched, and the sum of
the control weights is equal to the number of uniquely matched
control units. See
subclass
(or the total number of subclasses from full or
exact matching). Unmatched units have NA
.data
(the left-hand side of formula
).formula
).matchit(treat ~ X, ...)
command, where treat
is the vector of treatment assignments and
X
are the covariates to be used in the matching. There are a
number of matching options, detailed below. The full syntax is
matchit(formula, data=NULL, discard=0, exact=FALSE, replace=FALSE,
ratio=1, model="logit", reestimate=FALSE, nearest=TRUE, m.order=2,
caliper=0, calclosest=FALSE, mahvars=NULL, subclass=0, sub.by="treat",
counter=TRUE, full=FALSE, full.options=list(), ...)
A summary of the
results can be seen graphically using plot(matchitobject)
, or
numerically using summary(matchitobject)
.
print(matchitobject)
also prints out the output.help.matchit
to access the matchit reference
manual. The complete document is available online at