ngreifer / WeightIt

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

DAPSm weighting #60

Open barnabasharris opened 3 months ago

barnabasharris commented 3 months ago

Great package! Could this weighting method also be implemented?

https://github.com/gpapadog/DAPSm

ngreifer commented 3 months ago

This isn't a weighting method, it's a matching method, and so would be better suited for MatchIt (which I also maintain). However, you can already use the method with MatchIt. I'll provide instructions here in case you are interested in using it within the MatchIt framework.

DAPS involves computing a weighted average between the propensity score distance between units and the spatial distance between units, i.e., $d_{ij} = w |ps_i - psj| + (1 - w) \text{Dist}{ij}$. You can compute the propensity score distance between units by estimating the propensity score and then supplying it to euclidean_dist(). Then you can compute the spatial distance however you want (e.g., using the instructions in the article). Then you pick a value of $w$ and compute the new distance as `w ps_dist_mat + (1 - w) * spat_dist_mat. You can supply this to thedistanceargument ofmatchit()` to do whatever kind of matching you want using it (e.g., nearest neighbor, optimal, etc.).

Given that this method is very specific to spatial applications and can be implemented easily without much programming, I'm not inclined to add it as a fixed feature to MatchIt.