* * Dougherty, Introduction to Econometrics, 4th ed * Example from Section 12.4 * Apparent autocorrelation * open data demand.xls calendar(a) 1959:1 data(format=xls,org=columns) 1959:01 2003:01 adm book busi clot date dent doc dpi flow food furn gas gaso \$ hous legl mags mass opht padm pbook pbusi pclot pdent pdoc pflow pfood pfurn pgas pgaso phous plegl \$ pmags pmass pop popht prelg ptele ptob ptoys ptpe relg tele time tob toys tpe * set lghous = log(hous) set lgdpi = log(dpi) set lgprhous = log(100.0*phous/ptpe) * linreg lghous # constant lgdpi lgprhous * set u = %resids * graph(footer="Figure 12.6 Residuals from the regression of LGHOUS on LGDPI and LGPRHOUS") # u * prj fitted * * Because this uses two scales, the positioning of the graphs relative to each * other will depend upon the precise choices of scales. * graph(footer="Figure 12.7 Logarithms of DPI and actual and fitted expenditure on housing, 1971-1975",\$ key=upleft,klabels=||"Housing expenditure, actual","Housing expenditure, fitted","Disposable personal income"||,\$ overlay=line,ovlabel="log(DPI)",vlabel="log(housing expenditure)") 3 # lghous 1971:1 1975:1 # fitted 1971:1 1975:1 # lgdpi 1971:1 1975:1 * graph(footer="Figure 12.8 Logarithms of DPI and actual and fitted expenditure on housing, 1959-1966",\$ key=upleft,klabels=||"Housing expenditure, actual","Housing expenditure, fitted","Disposable personal income"||,\$ overlay=line,ovlabel="log(DPI)",vlabel="log(housing expenditure)") 3 # lghous 1959:1 1966:1 # fitted 1959:1 1966:1 # lgdpi 1959:1 1966:1 * linreg lghous # constant lgdpi lgprhous lghous{1}