/**************************************************** ECO375 Example Topic 3: Simple Regression Model ************************************************/ clear all set more off use http://bigblue.depaul.edu/jlee141/econdata/eco375/state_cig_data * dscribe data desc * 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 * get correlation coefficient corr packs_pc real_tax * get regression estimate reg packs_pc real_tax * plot the data with regression line tw (scatter packs_pc real_tax) (lfit packs_pc real_tax) * Generate Yhat and ei predict yhat predict ei, resid list real_tax packs_pc yhat e in 1/10 tw (scatter packs_pc real_tax) (scatter yhat real_tax) * Check the residuals for normality sum ei hist ei pnorm ei scatter ei real_tax, yline(0)