"glm"
The propensity scores are estimated using a generalized linear model (e.g., logistic regression). The formula
supplied to matchit()
is passed directly to glm()
, and predict.glm()
is used to compute the propensity scores. The link
argument can be specified as a link function supplied to binomial()
, e.g., "logit"
, which is the default. When link
is prepended by "linear."
, the linear predictor is used instead of the predicted probabilities. distance = "glm"
with link = "logit"
(logistic regression) is the default in matchit()
.
"gam"
The propensity scores are estimated using a generalized additive model. The formula
supplied to matchit()
is passed directly to mgcv::gam()
, and mgcv::predict.gam()
is used to compute the propensity scores. The link
argument can be specified as a link function supplied to binomial()
, e.g., "logit"
, which is the default. When link
is prepended by "linear."
, the linear predictor is used instead of the predicted probabilities. Note that unless the smoothing functions s()
, te()
, ti()
, or t2()
are used in formula
, a generalized additive model is identical to a generalized linear model and will estimate the same propensity scores as glm
. See the documentation for mgcv::gam()
, mgcv::formula.gam()
, and mgcv::gam.models()
for more information on how to specify these models. Also note that the formula returned in the matchit()
output object will be a simplified version of the supplied formula with smoothing terms removed (but all named variables present).
"gbm"
The propensity scores are estimated using a generalized boosted model. The formula
supplied to matchit()
is passed directly to gbm::gbm()
, and gbm::predict.gbm()
is used to compute the propensity scores. The optimal tree is chosen using 5-fold cross-validation by default, and this can be changed by supplying an argument to method
to distance.options
; see gbm::gbm.perf()
for details. The link
argument can be specified as "linear"
to use the linear predictor instead of the predicted probabilities. No other links are allowed. The tuning parameter defaults differ from gbm::gbm()
; they are as follows: n.trees = 1e4
, interaction.depth = 3
, shrinkage = .01
, bag.fraction = 1
, cv.folds = 5
, keep.data = FALSE
. These are the same defaults as used in WeightIt and twang, except for cv.folds
and keep.data
. Note this is not the same use of generalized boosted modeling as in twang; here, the number of trees is chosen based on cross-validation or out-of-bag error, rather than based on optimizing balance. twang should not be cited when using this method to estimate propensity scores.
"lasso"
, "ridge"
, "elasticnet"
The propensity scores are estimated using a lasso, ridge, or elastic net model, respectively. The formula
supplied to matchit()
is processed with model.matrix()
and passed to glmnet::cv.glmnet()
, and glmnet::predict.cv.glmnet()
is used to compute the propensity scores. The link
argument can be specified as a link function supplied to binomial()
, e.g., "logit"
, which is the default. When link
is prepended by "linear."
, the linear predictor is used instead of the predicted probabilities. When link = "log"
, a Poisson model is used. For distance = "elasticnet"
, the alpha
argument, which controls how to prioritize the lasso and ridge penalties in the elastic net, is set to .5 by default and can be changed by supplying an argument to alpha
in distance.options
. For "lasso"
and "ridge"
, alpha
is set to 1 and 0, respectively, and cannot be changed. The cv.glmnet()
defaults are used to select the tuning parameters and generate predictions and can be modified using distance.options
. If the s
argument is passed to distance.options
, it will be passed to predict.cv.glmnet()
. Note that because there is a random component to choosing the tuning parameter, results will vary across runs unless a seed is set.
"rpart"
The propensity scores are estimated using a classification tree. The formula
supplied to matchit()
is passed directly to rpart::rpart()
, and rpart::predict.rpart()
is used to compute the propensity scores. The link
argument is ignored, and predicted probabilities are always returned as the distance measure.
"randomforest"
The propensity scores are estimated using a random forest. The formula
supplied to matchit()
is passed directly to randomForest::randomForest()
, and randomForest::predict.randomForest()
is used to compute the propensity scores. The link
argument is ignored, and predicted probabilities are always returned as the distance measure. When s.weights
is supplied to matchit()
, it will not be passed to randomForest
because randomForest
does not accept weights.
"nnet"
The propensity scores are estimated using a single-hidden-layer neural network. The formula
supplied to matchit()
is passed directly to nnet::nnet()
, and fitted()
is used to compute the propensity scores. The link
argument is ignored, and predicted probabilities are always returned as the distance measure. An argument to size
must be supplied to distance.options
when using method = "nnet"
.
"cbps"
The propensity scores are estimated using the covariate balancing propensity score (CBPS) algorithm, which is a form of logistic regression where balance constraints are incorporated to a generalized method of moments estimation of of the model coefficients. The formula
supplied to matchit()
is passed directly to CBPS::CBPS()
, and fitted
is used to compute the propensity scores. The link
argument can be specified as "linear"
to use the linear predictor instead of the predicted probabilities. No other links are allowed. The estimand
argument supplied to matchit()
will be used to select the appropriate estimand for use in defining the balance constraints, so no argument needs to be supplied to ATT
in CBPS
.
"bart"
The propensity scores are estimated using Bayesian additive regression trees (BART). The formula
supplied to matchit()
is passed directly to dbarts::bart2()
, and dbarts::fitted()
is used to compute the propensity scores. The link
argument can be specified as "linear"
to use the linear predictor instead of the predicted probabilities. When s.weights
is supplied to matchit()
, it will not be passed to bart2
because the weights
argument in bart2
does not correspond to sampling weights.
"mahalanobis"
No propensity scores are estimated. Rather than using the propensity score difference as the distance between units, the Mahalanobis distance is used instead. See mahalanobis()
for details on how it is computed. The Mahalanobis distance is always computed using all the variables in formula
. With this specification, calipers and common support restrictions cannot be used and the distance
component of the output object will be empty because no propensity scores are estimated. The link
and distance.options
arguments are ignored. See individual methods pages for whether the Mahalanobis distance is allowed and how it is used. Sometimes this setting is just a placeholder to indicate that no propensity score is to be estimated (e.g., with method = "genetic"
). To perform Mahalanobis distance matching and estimate propensity scores to be used for a purpose other than matching, the mahvars
argument should be used along with a different specification to distance
. See the individual matching method pages for details on how to use mahvars
.