* * 2SLS estimation from pp 292-293 * open data consump.dat calendar 1950 data(format=prn,org=columns) 1950:1 1993:1 year y c * * Generate ix (can't use i) as the difference between y and c * set ix = y-c linreg c # constant y * * Save the coefficients and the %XX for use in the Hausman test * compute betaols=%beta,xxols=%seesq*%xx * * 2SLS estimates * instruments constant ix linreg(instruments) c # constant y * * The examples of the Hausman test in the RATS manual handle the scale factors a * bit differently. This calculation uses separate estimates of %seesq, while the * code shown in the RATS manual uses a common value. Note that the TEST * instruction correctly adjusts the degrees of freedom. * test(all,form=chisquared,covmat=%seesq*%xx-xxols,vector=betaols,title="Hausman Test")