* * Nerlove Exercise, part 2 * page 182 * open data nerlove.xls data(org=columns,format=xls) 1 145 tc q pl pf pk * * Generate needed variables * set ltc = log(tc) set lq = log(q) set lpl = log(pl) set lpk = log(pk) set lpf = log(pf) set ltcf = ltc-lpf set lplf = lpl-lpf set lpkf = lpk-lpf set lq2 = lq**2 * * Part (i): White's test for conditional heteroskedasticity, done using auxiliary * regressions. * linreg ltcf # constant lq lq2 lplf lpkf set ehatsq = %resids**2 set x1 = 1 set x2 = lq set x3 = lq2 set x4 = lplf set x5 = lpkf set x6 = lq2*lq set x7 = lq*lplf set x8 = lq*lpkf set x9 = lq2*lq2 set x10 = lq2*lplf set x11 = lq2*lpkf set x12 = lplf**2 set x13 = lplf*lpkf set x14 = lpkf**2 linreg ehatsq # x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 cdf(title="White Test for Heteroscedasticity") chisquare %trsquared 13 * * White test done using the RegWhiteTest procedure. Apply this immediately after * the regression that you want to test. * linreg ltcf # constant lq lq2 lplf lpkf @RegWhiteTest * * Part (j): Step 2 of the three-step WLS procedure * set qinv = 1/q linreg ehatsq # constant qinv * * Part (k): Model 4 with White standard errors * set sw = (0.0565+2.1377/q) set lqsq = lq**2 linreg(spread=sw,robusterrors) ltcf # constant lq lqsq lplf lpkf