------------------------------------------------------------------------------- log: d:\bill\fall2008\econ30331\cig_regression.log log type: text opened on: 28 Aug 2008, 15:59:05 . . use state_cig_data . . * dscribe data . desc Contains data from state_cig_data.dta obs: 1,020 vars: 7 28 Aug 2008 15:39 size: 29,580 (99.8% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- state str2 %9s 2-digit state code year int %8.0g year state_tax float %9.0g state tax in cents per pack retail_price float %9.0g average retail price, nominal federal_tax byte %8.0g federal tax in cents per pack packs_pc float %9.0g packs of cigarettes per capita cpi float %9.0g consumer price index, 2000=1.000 ------------------------------------------------------------------------------- Sorted by: . . * generate real taxes . gen real_tax=(state_tax+federal_tax)/cpi . . * get means of real tax and per capita consumption . sum packs_pc real_tax Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- packs_pc | 1020 106.6021 28.29377 31.9 245.4 real_tax | 1020 56.05339 18.45741 17.84456 145 . . * get correlation coefficient . corr packs_pc real_tax (obs=1020) | packs_pc real_tax -------------+------------------ packs_pc | 1.0000 real_tax | -0.6115 1.0000 . . * get regression estimate . reg packs_pc real_tax Source | SS df MS Number of obs = 1020 -------------+------------------------------ F( 1, 1018) = 607.95 Model | 305010.398 1 305010.398 Prob > F = 0.0000 Residual | 510736.995 1018 501.706282 R-squared = 0.3739 -------------+------------------------------ Adj R-squared = 0.3733 Total | 815747.392 1019 800.537186 Root MSE = 22.399 ------------------------------------------------------------------------------ packs_pc | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- real_tax | -.9373448 .038016 -24.66 0.000 -1.011944 -.862746 _cons | 159.1434 2.243373 70.94 0.000 154.7412 163.5456 ------------------------------------------------------------------------------ . . end of do-file . exit, clear