|
1. Diff-in-Diff with no covariates.
We use the dataset form Card & Krueger (1994)*.
use "http://fmwww.bc.edu/repec/bocode/c/CardKrueger1994.dta"
diff fte, t(treated) p(t)
For bootstrapped std. err.:
diff fte, t(treated) p(t) bs rep(50)
2. Diff-in-Diff with covariates.
diff fte, t(treated) p(t) cov(bk kfc roys)
diff fte, t(treated) p(t) cov(bk kfc roys) report
diff fte, t(treated) p(t) cov(bk kfc roys) report bs
3. Kernel Propensity Score Diff-in-Diff.
diff fte, t(treated) p(t) cov(bk kfc roys) kernel id(id)
diff fte, t(treated) p(t) cov(bk kfc roys) kernel id(id) support
diff fte, t(treated) p(t) cov(bk kfc roys) kernel id(id) support addcov(wendys)
diff fte, t(treated) p(t) kernel id(id) ktype(gaussian) pscore(_ps)
diff fte, t(treated) p(t) kernel id(id) ktype(gaussian) pscore(_ps) bs reps(50)
3. Kernel Propensity Score Diff-in-Diff (Repeated Cross Section - rcs).
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys)
diff fte, t(treated) p(t) kernel rcs ktype(gaussian) pscore(_ps)
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support addcov(wendys) bs reps
> (50)
4. Quantile Diff-in-Diff.
diff fte, t(treated) p(t) qdid(0.25)
diff fte, t(treated) p(t) qdid(0.50)
diff fte, t(treated) p(t) qdid(0.75)
diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys)
diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys) kernel id(id)
diff fte, t(treated) p(t) qdid(0.50) cov(bk kfc roys) kernel rcs
5. Balancing test of covariates.
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test id(id) kernel
diff fte, t(treated) p(t) cov(bk kfc roys wendys) test kernel rcs
6. Storing results with outreg2.
Install or update outreg2:
ssc install outreg2, replace
Run the following command after diff. Results will be stored in working directory (also
see help outreg2 for further options:
outreg2 using table_diff, ctitle(`r(depvar)') addstat(Mean control t(0), r(mean_c0),
Mean treated t(0), r(mean_t0), Diff t(0), r(diff0), Mean control t(1), r(mean_c1),
Mean treated t(1), r(mean_t1), Diff t(1), r(diff1)) label excel keep(_diff) nocons
|