** Chapter 23.4 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003 * * MODELS FOR DISCRETE CHOICE *=============================================================================== * 23.4.3 Hypothesis Tests * 23.4.4 Specification Tests for Binary Choice Models * * Example 23.5 (p. 789) Specification Tests in a Labor Force Participation Model * * Read Mroz female labor force data SAMPLE 1 753 READ (TableF4-1.txt) LFP WHRS KL6 K618 Age Educatn WWRPWG HHRS HA HE HW Income /SKIPLINES=37 * * Set up regression variables. GENR Age2=Age**2 GENR Kids=DUM(KL6+K618) * * Restricted model: * Estimate the Probit Model in Table 23.4 under the null hypothesis of homoskedasticity. * PROBIT LFP AGE AGE2 Income EDUCATN KIDS /COEF=B INDEX=XB IMR=LAMBDA * * The INDEX= option saves the index function x'Beta in the named variable. * The IMR= option saves the Inverse Mills Ratio (which is named Lambda * in equation (23-21)) in the named variable. This will be useful in LM tests * of homoskedasticity. Also save the Log of the likelihood Function for likelihood * ratio testing. GEN1 LLFR=$LLF * The output for the PROBIT command automatically generates an LR test of the * hypothesis that all the slopes are zero. * * Test whether the equation is the same for KIDS=1 and KIDS=0. SET NOWARNSKIP * KIDS=1 SKIPIF (KIDS) ?PROBIT LFP AGE AGE2 Income EDUCATN GEN1 LLFU1=$LLF DELETE SKIP$ * KIDS=0 SKIPIF (1-KIDS) ?PROBIT LFP AGE AGE2 Income EDUCATN GEN1 LLFU2=$LLF DELETE SKIP$ * LR test GEN1 LR=2*(LLFU1+LLFU2-LLFR) DISTRIB LR /TYPE=CHI DF=5 * * Unrestricted Model (heteroskedasticity) * * A Probit model with heteroskedastic disturbances can be estimated using the * NL command with the LOGDEN option. * * Define a SHAZAM character string. See the chapter SHAZAM PROCEDURES in the * SHAZAM User's Reference Manual for more details. Note that the COMLEN= * option with the SET command may be needed (for certain versions of SHAZAM) * to extend the maximum number of characters in a command line to, say, the * maximum available value of 255. * SET COMLEN=255 TERM: (B1*AGE+B2*AGE2+B3*Income+B4*Educatn+B5*Kids+B6)/EXP(Gamma1*Kids+Gamma2*Income) * * Set up the log-likelihood function for the Probit model with * heteroscedasticity (equation 23-33) using the NL command. The starting values for * the parameter estimates are set to the estimates from the PROBIT model * which assumes no heteroscedasticity (i.e. GAMMA=0). Also note that a * character string must be enclosed using square brackets. DIM BHET 8 COPY B BHET /FROWS=1;6 TROWS=1;6 SET NOWARN NL 1 / LOGDEN NCOEF=8 GENRVAR START=BHET CONV=.0000001 COV=V * This is a fairly difficult estimation problem (see p. 789 of the textbook), * and SHAZAM quits after three iterations at the default convergence settings. * These can be tightened up using the CONV= option, and this gives us reasonable * estimates (which nonetheless differ considerably from the estimates in Table 23.4). EQ LFP*LOG(NCDF([TERM]))+(1-LFP)*LOG(1-NCDF([TERM])) END * Likelihood Ratio Test of the null hypothesis of homoskedasticity. GEN1 LR=2*($LLF-LLFR) PRINT LR * LM test * First calculate the variables gi xi in (23-29). In the probit model, gi = Lambda_i * (see equation (23-21)), which has been saved by the PROBIT /IMG= option. GENR ONE=1 GENR L1=LAMBDA*AGE GENR L2=LAMBDA*AGE2 GENR L3=LAMBDA*INCOME GENR L4=LAMBDA*EDUCATN GENR L5=LAMBDA*KIDS * By (23-35), the derivatives of the log-likelihood with respect to the Gamma_i * parameters must also be calculated. GENR L6=-LAMBDA*XB*KIDS GENR L7=-LAMBDA*XB*Income COPY LAMBDA L1-L7 GX * Calculate the LM statistic (23-29), using the BHHH estimator for the covariance * matrix. MATRIX LM=ONE'GX*INV(GX'GX)*GX'ONE PRINT LM * * Calculate the Wald test as in (23-27). * Extract the lower 2x2 diagonal submatrix from the estimated covariance matrix. MATRIX VM=V(7;8,7;8) MATRIX BM=GAMMA1|GAMMA2 MATRIX W=BM*INV(VM)*BM' PRINT W * Now take significance levels. DISTRIB LR LM W /TYPE=CHI DF=2 * The test results are consistent, even though they do not agree with the textbook * results. * STOP * *=============================================================================== Updated November 26, 2008