** Chapter 11.4 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * NONLINEAR REGRESSIONS AND NONLINEAR LEAST SQUARES * 11.4 HYPOTHESIS TESTING AND PARAMETRIC RESTRICTIONS * * This tutorial reviews hypothesis testing in non-linear models in SHAZAM. * *=============================================================================== * * Example 11.8 Hypothesis Tests in a Nonlinear Regression Model * * SHAZAM does not report an F-statistic when the TEST command is *invoked after non-linear estimation. This is probably because the *F-test is only asymptotically valid in non-linear estimation, *even when the errors are normal. Nevertheless, the F-test can *be computed manually. * * Reestimate the non-linear model in Section 11.3.1. * READ (TableF5-1.prn) Year qtr GDP C Inv G Y CPI M1 r / SKIPLINES=1 * * The restricted model where Gamma=1 corresponds to the OLS estimates. * TIME 1950.1 4 SAMPLE 1950.1 2000.4 ?OLS C Y / RESID=e COEF=b * * Store the SSE for this model in SbSTAR. * GEN1 SbSTAR=$SSE * * Estimate the unrestricted model * ?NL 1 / NCOEF=3 ?EQ C=ALPHA+BETA*Y**GAMMA ?END * * The Wald command is directly computed by the TEST command. * TEST GAMMA=1 * * The numbers are slightly different from those reported in * the textbook; the estimated covariance matrices are * not the same, probably because the estimation algorithms * differ. Such differences are not unusual in non-linear * estimation. * * Compute the F-statistic in accordance with equation (11-20), * using temporary variables generated by NL. * GEN1 J=1 GEN1 F=((SbSTAR-$SSE)/J)/($SSE/($N-$K)) GEN1 DF1=J GEN1 DF2=$N-$K PRINT F DF1 DF2 * * The Lagrange multiplier test is based on the regression of *the OLS residuals e on the pseudoregressors evaluated at *the OLS estimates -- Y and Beta*Y*lnY. The latter is computed as * GENR x2STAR=b(1)*Y*LOG(Y) ?OLS e Y x2STAR * * The test statistic is N times R-squared. * GEN1 LM=$N*$R2 PRINT LM * * Calculate the asymptotic p-values for these statistics. * DISTRIB F /TYPE=F DF1=J DF2=DF2 DISTRIB LM /TYPE=CHI DF=1 * STOP * *=============================================================================== * * Updated September 29, 2008