ngreifer / WeightIt

WeightIt: an R package for propensity score weighting
https://ngreifer.github.io/WeightIt/
102 stars 12 forks source link

Inconsistent ATT weights #29

Closed OtterCuber closed 2 years ago

OtterCuber commented 2 years ago

In one of your references (Austin, 2011), ATT weights are calculated as 1 for the treated group and ps/(1-ps) for the control group. However, this doesn't appear to be how you implemented the ATT weighting estimator in get_w_from_ps().

Could you clarify how ATT is calculated and what reference you used? Thank you.

ngreifer commented 2 years ago

In get_w_from_ps(), I use the formula w_ATT = ps * w_ATE, where w_ATE are the usual ATE weights (A/ps + (1-A)/(1-ps), where A is treatment) and ps is the propensity score. You can see that these definitions are equivalent. This perspective on computing weights (i.e., starting with the ATE weights and then multiplying them by a function of the propensity score) is discussed in Li et a. (2018). You are welcome to verify that the weights are correctly computed yourself. If you find they are not, please let me know!

The way get_w_from_ps() is coded makes the code generalizable to multiple (i.e., more than 2) treatment levels, so it uses a propensity score matrix, where each unit gets a propensity score for each level of the treatment.

OtterCuber commented 2 years ago

I can confirm that these two methods are equivalent. Thank you for your clarification!