10
1 Michigan.do

Michigan.do

Embed Size (px)

DESCRIPTION

Michigan.do. . * construct new variables; . gen mi=state==26; . * michigan dummy; . gen hike=month>=33; . * treatment period dummy; . gen treatment=hike*mi;. . * get means of smoking rates for the 2x2 box; . sort mi hike; . by mi hike: sum smoked;. . by mi hike: sum smoked; - PowerPoint PPT Presentation

Citation preview

Page 1: Michigan.do

1

Michigan.do

Page 2: Michigan.do

2

• . * construct new variables;

• . gen mi=state==26;

• . * michigan dummy;

• . gen hike=month>=33;

• . * treatment period dummy;

• . gen treatment=hike*mi;

Page 3: Michigan.do

3

• . * get means of smoking rates for the 2x2 box;

• . sort mi hike;

• . by mi hike: sum smoked;

Page 4: Michigan.do

4

• . by mi hike: sum smoked;• -------------------------------------------------------------------------------• -> mi = 0, hike = 0• Variable | Obs Mean Std. Dev. Min Max• -------------+--------------------------------------------------------• smoked | 26441 .1950002 .3962083 0 1• -------------------------------------------------------------------------------• -> mi = 0, hike = 1• Variable | Obs Mean Std. Dev. Min Max• -------------+--------------------------------------------------------• smoked | 18852 .1827923 .3865064 0 1• -------------------------------------------------------------------------------• -> mi = 1, hike = 0• Variable | Obs Mean Std. Dev. Min Max• -------------+--------------------------------------------------------• smoked | 17790 .1957279 .3967712 0 1• -------------------------------------------------------------------------------• -> mi = 1, hike = 1• Variable | Obs Mean Std. Dev. Min Max• -------------+--------------------------------------------------------• smoked | 12943 .1783203 .382797 0 1

Page 5: Michigan.do

5

Smoking Rates

Time Period

Before After Diff.

States

MI 0.1957279 0.1783203 -.01741

All

others

0.1950002 0.1827923 -.01221

-.0051997

Page 6: Michigan.do

6

• . * now run the regression;• . reg smoked mi hike treatment;• Source | SS df MS Number of obs = 76026• -------------+------------------------------ F( 3, 76022) = 8.59• Model | 3.95288903 3 1.31762968 Prob > F = 0.0000• Residual | 11663.5888 76022 .153423862 R-squared = 0.0003• -------------+------------------------------ Adj R-squared = 0.0003• Total | 11667.5417 76025 .153469803 Root MSE = .39169• ------------------------------------------------------------------------------• smoked | Coef. Std. Err. t P>|t| [95% Conf. Interval]• -------------+----------------------------------------------------------------• mi | .0007277 .0037982 0.19 0.848 -.0067168 .0081723• hike | -.0122079 .0037337 -3.27 0.001 -.019526 -.0048898• treatment | -.0051997 .0058668 -0.89 0.375 -.0166985 .0062991• _cons | .1950002 .0024088 80.95 0.000 .1902789 .1997215• ------------------------------------------------------------------------------

Notice the estimate for treatment is arithmeticallyIdentical to the number from the 2x2 box

Page 7: Michigan.do

7

• . * now control for observed characteristics;

• . * generate dummy variables to control for race, parity, education and age;

• . xi i.age i.mrace3 i.meduc6 i.ageg;

• . * add these variables to the model;

• . reg smoked mi hike treatment _I*;

Page 8: Michigan.do

8

• . reg smoked mi hike treatment _I*;• Source | SS df MS Number of obs = 76026• -------------+------------------------------ F( 15, 76010) = 474.06• Model | 998.136229 15 66.5424153 Prob > F = 0.0000• Residual | 10669.4055 76010 .140368445 R-squared = 0.0855• -------------+------------------------------ Adj R-squared = 0.0854• Total | 11667.5417 76025 .153469803 Root MSE = .37466• ------------------------------------------------------------------------------• smoked | Coef. Std. Err. t P>|t| [95% Conf. Interval]• -------------+----------------------------------------------------------------• mi | -.0039841 .0036501 -1.09 0.275 -.0111382 .00317• hike | -.0030636 .0035745 -0.86 0.391 -.0100696 .0039424• treatment | -.0051552 .0056122 -0.92 0.358 -.0161551 .0058447• _Iageg_2 | .105199 .0052283 20.12 0.000 .0949516 .1154464• Delete some results • _Imeduc6_6 | .0156193 .0145937 1.07 0.284 -.0129844 .044223• _cons | .1476714 .0092008 16.05 0.000 .1296378 .165705• ------------------------------------------------------------------------------

Page 9: Michigan.do

9

• . * now control for all time periods and all states;

• . * need to define time and state dummies;

• . * in the regression, drop the mi and hike variables;

• . xi i.age i.mrace3 i.meduc6 i.ageg i.state i.month;

• . reg smoked treatment _I*;

Page 10: Michigan.do

10

• . reg smoked treatment _I*;• Source | SS df MS Number of obs = 76026• -------------+------------------------------ F( 70, 75955) = 102.48• Model | 1006.80931 70 14.3829901 Prob > F = 0.0000• Residual | 10660.7324 75955 .140355901 R-squared = 0.0863• -------------+------------------------------ Adj R-squared = 0.0854• Total | 11667.5417 76025 .153469803 Root MSE = .37464• ------------------------------------------------------------------------------• smoked | Coef. Std. Err. t P>|t| [95% Conf. Interval]• -------------+----------------------------------------------------------------• treatment | -.0053194 .0056134 -0.95 0.343 -.0163216 .0056828• _Iageg_2 | .1051191 .0052311 20.10 0.000 .0948663 .115372• Delete some results• _Istate_26 | -.0046835 .0051651 -0.91 0.365 -.0148071 .0054402• _Istate_42 | -.0009752 .0045039 -0.22 0.829 -.0098028 .0078525• _Imonth_2 | .0273311 .0136851 2.00 0.046 .0005083 .0541538• Delete some results

• _Imonth_3 | .0305209 .014018 2.18 0.029 .0030457 .0579961• _Imonth_56 | .009216 .0148571 0.62 0.535 -.0199038 .0383358• _cons | .1292655 .0138104 9.36 0.000 .1021972 .1563339• ------------------------------------------------------------------------------