* * HAUSMAN.RPF * RATS Version 8, Users' Guide, Example 3.7 * Hausman test for simultaneous equations * cal(a) 1920 allocate 1941:1 open data klein.prn data(org=columns,format=prn) / cons $ profit privwage invst klagged1 prod govtwage govtexp taxes set wagebill = privwage+govtwage set trend = t-1931:1 set capital = klagged1+invst smpl 1921:1 1941:1 instruments constant trend govtwage govtexp taxes profit{1} $ capital{1} prod{1} * equation conseq cons # constant profit{0 1} wagebill equation invseq invst # constant profit{0 1} capital{1} equation wageeq privwage # constant prod{0 1} trend * group klein conseq invseq wageeq * * Compute 2SLS estimates using SUR. Save the covariance matrix of * residuals in VCV2SLS, the coefficients and %XX matrix in BETA2SLS and * COV2SLS. * sur(model=klein,inst,cv=%identity(3),cvout=vcv2sls) compute [symmetric] cov2sls=%xx compute [vector] beta2sls=%beta * * Compute covariance matrix of 2SLS. Apply SUR with CV=INV(VCV2SLS), * then compute the matrix expression from the preceding page. * sur(model=klein,inst,nosigma,cv=inv(vcv2sls),noprint) compute cov2sls=%mqform(inv(%xx),cov2sls) * * Compute 3SLS estimates. * sur(model=klein,inst) * test(all,vector=beta2sls,covmat=cov2sls-%xx)