*** Lec 7: DID Regression *** Card-Krueger (AER, 1994) *** Last update 2018/5/30 * specify working directory cd "XXX: Your Directory" * open data in the directory use "minimum_wage_data_v11.dta", clear * Note: Many variables are dropped from the original data. * in order to focus your learning on the essentials. * start log * log using lec7.log, replace * do not pause for -more- message set more off * describe the data * describe * take a look at the data structure * list in 1/10 * check if sample balance * tab state tab chain co_owned * 1. Raw DID Table * * 1-a: Compare means across states for each period * ttest fte0, by(state) ttest fte1, by(state) * ==> Compare the outputs with Table 3 in Card-Krueger. * ==> See that s.e. of the difference differs slightly from Card-Krueger. * This is b/c t-test assumes equal variance; Need to allow for diff. var. * ttest fte0, by(state) unequal ttest fte1, by(state) unequal * 1-b: Compare means across periods for each state * ttest fte0 == fte1 if state == 0, unpaired unequal /* PA */ ttest fte0 == fte1 if state == 1, unpaired unequal /* NJ */ * ==> Compare the outputs with Table 3 in Card-Krueger. * ==> See that s.e. of the difference differs slightly from Card-Krueger. * I'm guessing they are misreported. ttest fte0 == fte1 if state == 0 /* PA */ ttest fte0 == fte1 if state == 1 /* NJ */ * 1-c. DID Regression * * Problem: FTE before and after are recorded as separate variables; they are the same var, just recorded in diff. periods. * Need to change data format wide to long form * help reshape reshape long fte wage_st, i(sheet) j(period) * ==> Note: Other variables are simply copied. * * label values of the period var * gen state_period = state*period reg fte state period state_period outreg2 using myDID, replace ctitle(DID (1)) excel * see the following produce the same results. * reg fte i.state##i.period * only for advanced students: use bootstrapped/clustered standard errors * * reg fte i.state##i.period, vce(boot, reps(500)) * reg fte i.state##i.period, cl(state) * 2. Regression-adjusted DID * drop state_period reshape wide fte wage_st, i(sheet) j(period) drop if fte0 ==. | fte1 ==. | wage_st0 ==. | wage_st1 ==. gen diff_fte = fte1 - fte0 reg diff_fte state outreg2 using myDID, append ctitle(DID (2)) excel reg diff_fte state i.chain i.co_own outreg2 using myDID, append ctitle(DID (3)) excel * ==> Results differ slightly from Table 4 in Card-Krueger. * This reason is that for some reason, Card-Krueger used 357 obs. * But we end up using 351 obs, following the description of the paper. * I'm guessing that the paper doesn't explains something it should.