# delimit; set more 1; set memory 80m; * increase maximum variables; set matsize 200; *define log; log using michigan.log,replace; *read in stata data file; use michigan; * construct new variables; gen mi=state==26; * michigan dummy; gen hike=month>=33; * treatment period dummy; gen treatment=hike*mi; * treatment dummy variable; label var mi "michigan dummy variable"; label var hike "time period after tax hike"; label var treatment "=1 if in in after tax hike"; ***********************************************; ***** question 1; ***********************************************; * get means of smoking rates for the 2xs box; sort mi hike; by mi hike: sum smoked, detail; *** get row differences and standard errors; *** on differences; by mi: reg smoked hike; ***********************************************; ***** question 2; ***********************************************; * now run the regression; reg smoked mi hike treatment; ***********************************************; ***** question 3; ***********************************************; xi i.age i.mrace3 i.meduc6 i.parity i.state i.month*mi; reg smoked mi _Imonth* treatment; ***********************************************; ***** question 4; ***********************************************; * add other variables to the model; reg smoked mi _Imonth* _Ip* _Ime* _Imrace* _Iage* married hispanic treatment; ***********************************************; ***** question 5 -- pretreatment mean for MI; ***********************************************; sum smoked if mi==1 & (month>=21&month<=32); ***********************************************; ***** question 6; ***********************************************; **** unrestricted model; reg smoked mi _Imonth_2-_Imonth_32 _Ip* _Ime* _Imrace* _Iage* _ImonXmi_2-_ImonXmi_32 married hispanic if month<=32; test _ImonXmi_2 _ImonXmi_3 _ImonXmi_4 _ImonXmi_5 _ImonXmi_6 _ImonXmi_7 _ImonXmi_8 _ImonXmi_9 _ImonXmi_10 _ImonXmi_11 _ImonXmi_12 _ImonXmi_13 _ImonXmi_14 _ImonXmi_15 _ImonXmi_16 _ImonXmi_17 _ImonXmi_18 _ImonXmi_19 _ImonXmi_20 _ImonXmi_21 _ImonXmi_22 _ImonXmi_23 _ImonXmi_24 _ImonXmi_25 _ImonXmi_26 _ImonXmi_27 _ImonXmi_28 _ImonXmi_29 _ImonXmi_30 _ImonXmi_31 _ImonXmi_32; **** restricted model; reg smoked mi _Imonth_2-_Imonth_32 _Ip* _Ime* _Imrace* _Iage* married hispanic if month<=32; ***********************************************; ***** question 7 -- pennsylvania; ***********************************************; **** unrestricted model; reg smoked mi _Imonth_2-_Imonth_32 _Ip* _Ime* _Imrace* _Iage* _ImonXmi_2-_ImonXmi_32 married hispanic if month<=32 & (state>=26); test _ImonXmi_2 _ImonXmi_3 _ImonXmi_4 _ImonXmi_5 _ImonXmi_6 _ImonXmi_7 _ImonXmi_8 _ImonXmi_9 _ImonXmi_10 _ImonXmi_11 _ImonXmi_12 _ImonXmi_13 _ImonXmi_14 _ImonXmi_15 _ImonXmi_16 _ImonXmi_17 _ImonXmi_18 _ImonXmi_19 _ImonXmi_20 _ImonXmi_21 _ImonXmi_22 _ImonXmi_23 _ImonXmi_24 _ImonXmi_25 _ImonXmi_26 _ImonXmi_27 _ImonXmi_28 _ImonXmi_29 _ImonXmi_30 _ImonXmi_31 _ImonXmi_32; ***********************************************; ***** question 7 -- iowa; ***********************************************; **** unrestricted model; reg smoked mi _Imonth_2-_Imonth_32 _Ip* _Ime* _Imrace* _Iage* _ImonXmi_2-_ImonXmi_32 married hispanic if month<=32 & (state==19|state==26); test _ImonXmi_2 _ImonXmi_3 _ImonXmi_4 _ImonXmi_5 _ImonXmi_6 _ImonXmi_7 _ImonXmi_8 _ImonXmi_9 _ImonXmi_10 _ImonXmi_11 _ImonXmi_12 _ImonXmi_13 _ImonXmi_14 _ImonXmi_15 _ImonXmi_16 _ImonXmi_17 _ImonXmi_18 _ImonXmi_19 _ImonXmi_20 _ImonXmi_21 _ImonXmi_22 _ImonXmi_23 _ImonXmi_24 _ImonXmi_25 _ImonXmi_26 _ImonXmi_27 _ImonXmi_28 _ImonXmi_29 _ImonXmi_30 _ImonXmi_31 _ImonXmi_32; ***********************************************; ***** question 9; ***********************************************; gen wgt1=50*(1-mi)+mi; gen wgt2=200*(1-mi)+mi; reg smoked mi _Imonth* _Ip* _Ime* _Imrace* _Iage* married hispanic treatment [fweight=wgt1]; reg smoked mi _Imonth* _Ip* _Ime* _Imrace* _Iage* married hispanic treatment [fweight=wgt2]; log close;