* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapter 7.4 A Linear Probability Model READ (coke.dat) / names * Summary statistics STAT / ALL * The dependent variable is a 0-1 variable * Estimation results page 275. OLS coke pratio dis_coke dis_peps / PREDICT=yhat * Predicted probabilites should be in the (0,1) range. * Count the number of predictions that are less than zero * and greater than one (see discussion on page 275). GENR c1=(yhat.lt.0) GENR c2=(yhat.gt.1) STAT c1 c2 / SUMS=count PRINT count * Chapter 8.6 Heteroskedasticity in the Linear Probability Model * LS-robust estimation reported in Table 8.1, page 320. OLS coke pratio dis_coke dis_peps / HETCOV GENR W=1/(yhat*(1-yhat)) * GLS-trunc estimation reported in Table 8.1, page 320. IF (yhat.lt.0.01) W=1/(0.01*(1-0.01)) OLS coke pratio dis_coke dis_peps / WEIGHT=W * GLS-omit estimation reported in Table 8.1, page 320. SET NOWARNSKIP SKIPIF (yhat.lt.0.01) OLS coke pratio dis_coke dis_peps / WEIGHT=W DELETE SKIP$ * Chapter 16 Probit and Logit Models * Estimation results in Table 16.1, page 596. * Least squares with heteroskedasticity-robust standard errors. OLS coke pratio dis_coke dis_peps / HETCOV COEF=LPM STDERR=SE * The White standard errors reported in the first column of Table 16.1 * are calculated with an adjustment that scales the variance matrix * using N/(N-K) as follows. GEN1 N=$N GEN1 K=$K SAMPLE 1 K GENR SEadjust=SE*sqrt(N/(N-K)) FORMAT(F10.5,2F10.4) PRINT LPM SE SEadjust / FORMAT * Probit Estimation reported in Table 16.1, page 596. SAMPLE 1 N PROBIT coke pratio dis_coke dis_peps * Hypothesis test - bottom of page 597. TEST dis_coke = -dis_peps * Now construct a likelihood ratio test, page 598. * Save the value of the log-likelihood function GEN1 LU=$LLF * Restricted Probit estimation GENR display = (dis_coke - dis_peps) PROBIT coke pratio display GEN1 LR=$LLF * Calculate the likelihood ratio test statistic, page 598. GEN1 LR=2*(LU-LR) * Calculate a p-value DISTRIB LR / TYPE=CHI DF=1 GEN1 pvalue=1-$CDF PRINT LR pvalue * Logit Estimation reported in Table 16.1, page 596. LOGIT coke pratio dis_coke dis_peps STOP