Usage
matchit <- matchit(formula, data, model="logit", discard=0, reestimate=FALSE, nearest=TRUE,
replace=FALSE, m.order=2, ratio=1, caliper=0, calclosest=FALSE,
subclass=0, sub.by="treat", mahvars=NULL, exact=FALSE, counter=TRUE, full=FALSE, full.options=list(),...)
Arguments
formula
(required). Takes the form of T ~ X1 + X2
, where T
is a binary
treatment indicator and X1
and X2
are the pre-treatment covariates, and T
,
X1
, and X2
are contained
data
(required). Data frame containing the variables called in the formula
.
The dataframe should not include variables with the names psclass
, psweights
, or
pscore
, as these are expressly reserved in the o
model
Method used to estimate the propensity score. May be "logit" (default),
"probit", "nnet", "GAM", or "cart".
discard
Whether to discard units that fall outside some measure of support of the
distance score. 0 (default)=keep all units. 1=keep all units with common support. 2=discard
only control units outside the support of the distance measure of the treated units.
reestimate
Specifies whether to reestimate the propensity score model after
discarding units (default=FALSE).
nearest
Whether to perform nearest-neighbor matching (default=TRUE).
replace
Whether to match with replacement (default=FALSE).
m.order
Order in which to match treated units with control units. 1=optimal (requires ``optmatch"
package), 2 (default)=from high to low, 3=from low to high, 4=random order.
ratio
The number of control units to be matched to each treated unit (default=1).
caliper
Standard deviations of the propensity score within which to draw control
units (default=0).
calclosest
If caliper!=0
, whether to take the nearest available match if
no matches are available within caliper
(default=FALSE).
subclass
Either a scaler specifying the number of subclasses (default=0) or a
vector of probabilities to create quantiles based on sub.by
.
sub.by
If subclass!=0
, by what criteria to subclassify. "treat" (default)
=by the number of treated units, "control"=by the number of control units, "all"=by the total
number of units.
mahvars
Variables on which to perform Mahalanobis matching within each caliper
(default=NULL). Should be entered as a vector of names of variables in data
.
exact
"FALSE" (default)=no exact matching. "TRUE"=exact matching on all
variables in formula
. A vector of variable names (that are in data
to indicate
separate variables on which to exact match, in combination with matching on the pr
counter
Whether to display counter indicating the progress of the matching
(default=TRUE).
full
Whether to do full matching (default=FALSE). Requires ``optmatch" package.
full.options
Additional options for full matching.
...
Additional arguments to be passed to matchit
, depending on the model
to be used.