* 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
LOGIT YESVM PUB12 PUB34 PUB5 PRIV YEARS SCHOOL LOGINC PTCON / INDEX=LINDEX
* Translate the logit index to a probability
GENR P=1/(1+EXP(-LINDEX))
SORT LINDEX P
GRAPH P LINDEX / LINEONLY
* Now try the PROBIT model
PROBIT YESVM PUB12 PUB34 PUB5 PRIV YEARS SCHOOL LOGINC PTCON / INDEX=PINDEX
* Translate the probit index to a probability
GENR P=NCDF(PINDEX)
SORT PINDEX P
GRAPH P PINDEX / LINEONLY
* Note that some of the variables are log-transformed variables.
* Use the LOG option to compute elasticities assuming log-transformed
* variables.
LOGIT YESVM PUB12 PUB34 PUB5 PRIV YEARS SCHOOL LOGINC PTCON / LOG
PROBIT YESVM PUB12 PUB34 PUB5 PRIV YEARS SCHOOL LOGINC PTCON / LOG
STOP