I'm using Stata 14 with Windows 10 OS.
I want to perform a dif-in-dif nearest neighbor matching. The thing is I have more than one treatment episode (which I´m dealing separately). Nevertheless, I want to take several variables to first line of observations for each id, so I can do the match before the timing treatment.
I´m sending below a pick of my data.
I want to perform a dif-in-dif nearest neighbor matching. The thing is I have more than one treatment episode (which I´m dealing separately). Nevertheless, I want to take several variables to first line of observations for each id, so I can do the match before the timing treatment.
I´m sending below a pick of my data.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id qdate MeanRecPre1 MeanRecPre2 MeanRecCr1 MeanRecCr2 MeanRecCr3 MeanRecPos1 MeanRecPos2 MeanRecPos3) 12 168 .19730955 . . . . . . . 12 170 . . .1041995 . . . . . 12 175 . . . . . .12063727 . . 12 178 . . . .13331863 . . . . 12 184 . . . . . . .1194409 . 12 188 . .13765518 . . . . . . 12 213 . . . . .1686768 . . . 12 229 . . . . . . . .12797551 13 168 .9611338 . . . . . . . 13 170 . . .6560199 . . . . . 13 175 . . . . . .7507268 . . 13 178 . . . .4896258 . . . . 13 184 . . . . . . .5349047 . 13 188 . .6013946 . . . . . . 13 213 . . . . .53404635 . . . 13 229 . . . . . . . .3342379 14 212 . .6250144 . . . . . . 14 213 . . . . .5266255 . . . 14 229 . . . . . . . .4023241 15 200 . .56327945 . . . . . . 15 213 . . . . .5713364 . . . 15 229 . . . . . . . .35276 end format %tq qdate
Comment