------------------------------------------------------------------------------- log: D:\bill\fall2008\econ30331\state_cig_data_2.log log type: text opened on: 24 Sep 2008, 16:33:36 . . use state_cig_data . . . * generate real taxes . gen real_tax=(state_tax+federal_tax)/cpi . . * construct new variables . . * time trend . gen trend=year-1981 . label var trend "=1 in 1st year, 2 in second, etc" . . . * tobacco producing state . gen tob_state=(state=="NC"|state=="VA"|state=="SC"|state=="KY"|state=="MD"|st > ate=="TN") . label var tob_state "=1 if tobacco producing state" . . * run regression with tax and trend . reg packs_pc real_tax trend Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 2, 1017) = 418.36 Model | 368205.64 2 184102.82 Prob > F = 0.0000 Residual | 447541.752 1017 440.06072 R-squared = 0.4514 -------------+------------------------------ Adj R-squared = 0.4503 Total | 815747.392 1019 800.537186 Root MSE = 20.978 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.7349566 .0394065 -18.65 0.000 -.812284 -.6576292 trend | -1.510832 .1260754 -11.98 0.000 -1.758229 -1.263434 _cons | 162.1518 2.115978 76.63 0.000 157.9996 166.304 ------------------------------------------------------------------------------ . . * add tobacco producing state dummy . reg packs_pc real_tax trend tob_state Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 3, 1016) = 299.22 Model | 382648.514 3 127549.505 Prob > F = 0.0000 Residual | 433098.878 1016 426.278423 R-squared = 0.4691 -------------+------------------------------ Adj R-squared = 0.4675 Total | 815747.392 1019 800.537186 Root MSE = 20.647 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.6269276 .0429963 -14.58 0.000 -.7112994 -.5425558 trend | -1.658958 .126668 -13.10 0.000 -1.907519 -1.410398 tob_state | 12.94756 2.224374 5.82 0.000 8.582669 17.31246 _cons | 155.9803 2.336932 66.75 0.000 151.3946 160.5661 ------------------------------------------------------------------------------ . . * correlation between tax and other variables . reg real_tax trend tob_state Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 2, 1017) = 257.06 Model | 116564.372 2 58282.1858 Prob > F = 0.0000 Residual | 230584.642 1017 226.730228 R-squared = 0.3358 -------------+------------------------------ Adj R-squared = 0.3345 Total | 347149.013 1019 340.676166 Root MSE = 15.058 ------------------------------------------------------------------------------ real_tax | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- trend | 1.371175 .0817634 16.77 0.000 1.210731 1.53162 tob_state | -22.33085 1.463332 -15.26 0.000 -25.20235 -19.45936 _cons | 45.65438 .924806 49.37 0.000 43.83963 47.46913 ------------------------------------------------------------------------------ . . * now run a model with seperate dummies . * for each tobacco producing state . * test two hypothesis . * h1: coef are all zero . * h2: coef are all equal . . gen nc=state=="NC" . gen va=state=="VA" . gen ky=state=="KY" . gen md=state=="MD" . gen tn=state=="TN" . gen sc=state=="SC" . . * run unrestricted model for both hypotheses . reg packs_pc real_tax trend nc va ky md tn sc Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 8, 1011) = 145.41 Model | 436435.521 8 54554.4401 Prob > F = 0.0000 Residual | 379311.872 1011 375.184838 R-squared = 0.5350 -------------+------------------------------ Adj R-squared = 0.5313 Total | 815747.392 1019 800.537186 Root MSE = 19.37 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.5718702 .0414078 -13.81 0.000 -.6531252 -.4906151 trend | -1.734452 .1195248 -14.51 0.000 -1.968997 -1.499907 nc | 19.62917 4.548751 4.32 0.000 10.7031 28.55525 va | -.6130194 4.558021 -0.13 0.893 -9.557284 8.331245 ky | 58.23514 4.550303 12.80 0.000 49.30602 67.16426 md | -5.842746 4.380974 -1.33 0.183 -14.43959 2.754096 tn | 10.4233 4.430691 2.35 0.019 1.728894 19.1177 sc | 3.230404 4.494411 0.72 0.472 -5.589039 12.04985 _cons | 153.4667 2.233619 68.71 0.000 149.0837 157.8498 ------------------------------------------------------------------------------ . . * do test 1 . test nc va ky md tn sc ( 1) nc = 0 ( 2) va = 0 ( 3) ky = 0 ( 4) md = 0 ( 5) tn = 0 ( 6) sc = 0 F( 6, 1011) = 30.31 Prob > F = 0.0000 . . * do test 2 . test nc=va=ky=md=tn=sc ( 1) nc - va = 0 ( 2) nc - ky = 0 ( 3) nc - md = 0 ( 4) nc - tn = 0 ( 5) nc - sc = 0 F( 5, 1011) = 28.67 Prob > F = 0.0000 . . * do test by brute force . * for h1, run restricted model . * (no state effects) . reg packs_pc real_tax trend Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 2, 1017) = 418.36 Model | 368205.64 2 184102.82 Prob > F = 0.0000 Residual | 447541.752 1017 440.06072 R-squared = 0.4514 -------------+------------------------------ Adj R-squared = 0.4503 Total | 815747.392 1019 800.537186 Root MSE = 20.978 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.7349566 .0394065 -18.65 0.000 -.812284 -.6576292 trend | -1.510832 .1260754 -11.98 0.000 -1.758229 -1.263434 _cons | 162.1518 2.115978 76.63 0.000 157.9996 166.304 ------------------------------------------------------------------------------ . . . * for h1, run resticted model . * on dummy for all tobacco producing states . reg packs_pc real_tax trend tob_state Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 3, 1016) = 299.22 Model | 382648.514 3 127549.505 Prob > F = 0.0000 Residual | 433098.878 1016 426.278423 R-squared = 0.4691 -------------+------------------------------ Adj R-squared = 0.4675 Total | 815747.392 1019 800.537186 Root MSE = 20.647 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.6269276 .0429963 -14.58 0.000 -.7112994 -.5425558 trend | -1.658958 .126668 -13.10 0.000 -1.907519 -1.410398 tob_state | 12.94756 2.224374 5.82 0.000 8.582669 17.31246 _cons | 155.9803 2.336932 66.75 0.000 151.3946 160.5661 ------------------------------------------------------------------------------ . . . end of do-file . cleaqr unrecognized command: cleaqr r(199); . clear . exit