Skip to content

Instantly share code, notes, and snippets.

@scunning1975
Last active March 7, 2023 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scunning1975/8e6812d25ee8d5b90cf8b11353cd3684 to your computer and use it in GitHub Desktop.
Save scunning1975/8e6812d25ee8d5b90cf8b11353cd3684 to your computer and use it in GitHub Desktop.
* Nearest neighbor matching using teffects
clear
capture log close
use https://github.com/scunning1975/mixtape/raw/master/training_inexact.dta, clear
* Minimized euclidean distance with usual variance and robust
teffects nnmatch (earnings age gpa) (treat), atet nn(1) metric(eucl) vce(iid)
teffects nnmatch (earnings age gpa) (treat), atet nn(1) metric(eucl) generate(match1)
* Minimized Maha distance with usual variance and robust
teffects nnmatch (earnings age gpa) (treat), atet nn(1) metric(maha) vce(iid)
teffects nnmatch (earnings age gpa) (treat), atet nn(1) metric(maha) generate(match2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment