* BIVARIATE PROBIT MODELS - Testing for zero error correlation by
* computing a Lagrange multiplier test statistic using the results
* from the estimation of 2 independent probits.
*
* Reference: Greene, Econometric Analysis, 2nd Edition, 1993,
* Examples 21.11 and 21.12, pp. 660-3.
*
* The data set on voting behaviour is from Pindyck and Rubinfeld,
* Econometric Models and Economic Forecasts,
* 1991, Third Edition, Table 10.8, p. 282;
* 1998, Fourth Edition, Table 11.8, p. 332.
*
* The variables are:
* YESVM = dummy variable equal to 1 if individual voted yes in the
* election; 0 if individual voted no.
* PUB12 = 1 if 1 or 2 children in public school; = 0 otherwise
* PUB34 = 1 if 3 or 4 children in public school; = 0 otherwise
* PUB5 = 1 if 5 or more children in public school; = 0 otherwise
* PRIV = 1 if 1 or more children in private school; = 0 otherwise
* YEARS = number of years living in the community
* SCHOOL= 1 if individual is employed as a teacher; = 0 otherwise
* LOGINC= logarithm of annual household income (in dollars)
* PTCON = logarithm of property taxes (in dollars) paid per year
*
SAMPLE 1 95
READ (school.txt) PUB12 PUB34 PUB5 PRIV YEARS SCHOOL LOGINC PTCON YESVM
IF ((PUB12+PUB34+PUB5).GE.1) PUBLIC=1
PROBIT PUBLIC LOGINC PTCON / INDEX=XB1
PROBIT YESVM LOGINC PTCON YEARS / INDEX=XB2
RENAME PUBLIC Y1
RENAME YESVM Y2
* Lagrange multiplier test - Greene (1993, Section 21.6, pp. 660-663)
GENR Q1=2*Y1-1
GENR Q2=2*Y2-1
GENR W1=Q1*XB1
GENR W2=Q2*XB2
GENR NORM1=EXP(-(W1**2)/2)/(2*$PI)
GENR NORM2=EXP(-(W2**2)/2)/(2*$PI)
GENR CDF1=NCDF(W1)
GENR CDF2=NCDF(W2)
GENR CDFN1=NCDF(-W1)
GENR CDFN2=NCDF(-W2)
GENR GV=Q1*Q2*NORM1*NORM2/(CDF1*CDF2)
GENR HV=NORM1*NORM1*NORM2*NORM2/(CDF1*CDFN1*CDF2*CDFN2)
?STAT GV HV / SUMS=TOT
GEN1 TOP=(TOT:1)**2
GEN1 LM=TOP/TOT:2
* The test statistic can be compared with a chi-square distribution
* with 1 degree of freedom. The 5% critical value is 3.84.
* If the test statistic exceeds the critical value then there is
* evidence to reject the null hypothesis of zero error correlation.
PRINT LM
STOP