clear ********************** *** Simulated Data *** ********************** set seed 12345 matrix m = (4,8) matrix sd = (.5,.5) drawnorm x1 x2, n(200) means(m) sds(sd) drawnorm u v g d = 0 replace d = 1 if v>0 g y1 = 1 + x1 + u g y2 = 3 + x2 + u g y = 0 replace y = y1 if d==0 replace y = y2 if d==1 g x = 0 replace x = x1 if d==0 replace x = x2 if d==1 reg y x if d==0 predict y0h reg y x if d==1 predict y1h twoway (scatter y x if d==0) (line y0h x) (scatter y x if d==1) (line y1h x) g te = y1h - y0h su te reg y x d ********************* *** WAGE1 example *** ********************* use "C:\Users\royj\Dropbox\eco5720\Data Sets- STATA\WAGE1.DTA", clear keep wage married educ exper tenure numdep reg wage married educ exper tenure numdep * You may need to install psmatch2 first using: "ssc install psmatch2" * psmatch2 married educ exper tenure numdep, out(wage) ai(1) ate n(1) logit pstest psgraph sort _id g teff = . replace teff = wage - _wage if _treated==1 replace teff = _wage - wage if _treated==0 su teff * An alternative command * teffects psmatch (wage) (married educ exper tenure numdep), ate nn(1) teoverlap, ptl(1) tebalance summarize