简体   繁体   中英

Nearest-neighbor matching with the Mahalanobis distance in R

I would like to use the MatchIt package in R to perform nearest neighbor matching using the Mahalanobis distance withing some caliper. Which of the following two parameters of the matchit function that are related to the Mahalanobis distance should I use:

  1. the distance="mahalanobis" param, or
  2. the mahvars param (eg, mahvars = c("X1", "X2") ?

What's the difference between the two?

The documentation is terse about this (see pages 16 and 19): https://imai.fas.harvard.edu/research/files/matchit.pdf .

You should use the latter. You need the distance argument to identify the propensity score that will be used to form the caliper. Setting mahvars will perform Mahalanobis distance matching on the mahvars variables, and the propensity score will be estimated based on the variables in the main formula. The caliper argument can then be specified, which defines the width of the caliper in units of the standard deviation of the propensity score.

From https://cran.r-project.org/web/packages/MatchIt/vi.nettes/matching-methods.html :

Setting the distance="mahalanobis" and method="nearest" make MatchIt to run Nearest-neighbour matching with the Mahalanobis distance, without the consideration of the propensity score. And the covariates supplied in the main formula are used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM