distance {Matchit} | R Documentation |
The distance function calculates the distance measure to be used in the matching,
usually the propensity score. It is a sub-function of matchit
.
distance <- distance(formula, model="logit", data, discard=0, reestimate=FALSE, counter=TRUE, ...)
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 in the same data frame. The + symbol means
"inclusion" not "addition." You may also include interaction terms in the form if
I(X1*X2) or squared terms in the form of I(X1^2) . |
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 output dataframe for MatchIt. |
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. 3=discard only treated units outside the support of the distance measure of the control units. |
reestimate |
Specifies whether to reestimate the propensity score model after discarding units (default=FALSE). |
counter |
Whether to display counter indicating the progress of the matching (default=TRUE). |
... |
Additional arguments to be passed to distance , depending on the model
to be used. |
This is a sub-function of the matchit
command, which calculates the distance
measure used in the matching, usually the propensity score. This function is called directly by
matchit
and does not generally need to be called directly by users; these details are
included for advanced users.
in.sample |
Vector of length n showing whether each unit was eligible for matching due to
common support restrictions with discard . |
pscore |
Vector of estimated propensity scores. |
treat |
The treatment indicator from data . |
covariates |
Covariates used in the right-hand side of the assignment model. |
assign.model |
Output of the assignment model. |
Daniel Ho <deho@fas.harvard.edu>; Kosuke Imai <kimai@princeton.edu>; Gary King <king@harvard.edu>; Elizabeth Stuart<stuart@stat.harvard.edu>
Please use help.matchit
to access the matchit reference
manual. The complete document is available online at
http://gking.harvard.edu/matchit.