Learn R Programming

MatchIt (version 1.0-1)

distance: Distance function: estimating propensity scores

Description

The distance function calculates the distance measure to be used in the matching, usually the propensity score. It is a sub-function of matchit.

Usage

distance <- distance(formula, model="logit", data, discard=0, reestimate=FALSE, counter=TRUE, ...)

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

Value

  • in.sampleVector of length n showing whether each unit was eligible for matching due to common support restrictions with discard.
  • pscoreVector of estimated propensity scores.
  • treatThe treatment indicator from data.
  • covariatesCovariates used in the right-hand side of the assignment model.
  • assign.modelOutput of the assignment model.

Details

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.

See Also

Please use help.matchit to access the matchit reference manual. The complete document is available online at http://gking.harvard.edu/matchit.