/*************************************************************** ECO375 Example Topic 4: Multiple Regression Model ****************************************************************/ * a simple random variable called mars generated and compare the R square between with/without it clear all set seed 12345678 use http://bigblue.depaul.edu/jlee141/econdata/eco375/wage1 * Multiple Regression Model regr wage educ exper * Generate a random variable gen mars = rnormal(0,1) * Multiple Regression with Mars regr wage educ exper mars * Multiple Regression with tenure regr wage educ exper tenure * Retricted F test Ho: b2=b3 =0 test exper tenure * Manual Calculation of Restricted F Statistic display [(5980.68 - 4966.30)/2]/[4966.30/522] * Residuals Comparison for three models quietly regr wage educ predict ei1, resid quietly regr wage educ exper predict ei2, resid quietly regr wage educ exper tenure predict ei3, resid * Summary Stat for the residuals sum ei* hist ei1, normal bin(16) saving(ei1, replace) hist ei2, normal bin(16) saving(ei2, replace) hist ei3, normal bin(16) saving(ei3, replace) graph combine ei1.gph ei2.gph ei3.gph, xcommon col(1) ycommon