* W.H. Greene, Econometric Analysis, Fourth Edition, 2000. SAMPLE 1 601 READ (FAIR_PT.shd) / NAMES * Doubly Censored (Two-Limit) Tobit, pp. 922-923. * Estimation results reported in Table 20.5. * Tobit estimation - left censored at 0 only TOBIT y z2 z3 z5 z7 z8 / COEF=ALPHA GEN1 NCOEF=$K GEN1 SIGA=SQRT($SIG2) SAMPLE 1 NCOEF GENR BETA=ALPHA*SIGA * The next value is used as the starting value for sigma * for the two-limit tobit estimation. The divide by 2 * is to avoid negative arguments for LOG. GEN1 BETA:7=SIGA/2 * Specify the log-likelihood function for two-limit tobit * (bottom of page 922). SAMPLE 1 601 * Re-code observations IF (y.GT.3.99) y=4 * Consider three types of observations IF (y.LE.0.01) d1=1 IF ((y.GT.0.01).AND.(y.LT.3.99)) d2=1 IF (y.GT.3.99) d3=1 BETAX: (B2*z2+B3*z3+B5*z5+B7*z7+B8*z8+B0) GENR CONST=SQRT(2*$PI) * Maximum likelihood estimation - censored at both 0 and 4 * Starting values are based on the Tobit estimates. * The choice of starting values is important. * Negative arguments for LOG will give warning messages: * ...WARNING...ILLEGAL LOG * These messages may be avoided by changing the starting values. NL / NCOEF=NCOEF LOGDEN START=BETA COEF=BHAT GENRVAR EQ d1*LOG(NCDF(-[BETAX]/SIG)) + & d2*LOG(EXP(-((y-[BETAX])/SIG)**2/2)/(CONST*SIG)) + & d3*LOG(1-NCDF((4-[BETAX])/SIG)) END * Estimate marginal effects as reported in the final column of Table 20.5. * Calculate the scale factor using the formula in the middle of p. 923. GENR BX=[BETAX] GENR AX1=(4-BX)/SIG GENR AX2=-BX/SIG STAT AX1 AX2 / MEAN=mu DISTRIB mu / TYPE=NORMAL CDF=CDF GEN1 scale=CDF:1-CDF:2 PRINT scale GEN1 K=NCOEF-2 SAMPLE 1 K GENR SLOPE=BHAT*scale PRINT BHAT SLOPE * Prediction with two-limit tobit - Reference: * G. S. Maddala (1983), Limited-dependent variables and * qualitative variables in econometrics, Cambridge University Press, * Equation (6.41), p. 161. SAMPLE 1 601 SET NOOUTPUT DISTRIB AX1 / CDF=CDF1 PDF=F1 DISTRIB AX2 / CDF=CDF2 PDF=F2 * Calculate the predictions GENR yhat=BX*(CDF1-CDF2)+SIG*(F2-F1)+(1-CDF1)*4 * Mean Square Error GENR ymsq=(y-yhat)**2 STAT ymsq / MEAN=mse PRINT mse * Squared Correlation between Observed and Expected Values STAT y yhat / COR=corr GEN1 RSQ=(corr:2)**2 PRINT RSQ STOP