* W.H. Greene, Econometric Analysis, Fourth Edition, 2000. SAMPLE 1 40 * Table A19.3 - Data on ship accidents READ (ship.shd) / NAMES * Missing values are assigned the code -999. SET MISSVALU=-999 SET SKIPMISS SET NOWARNMISS * Example 19.22 - Poisson Regression, pp. 881-882. * Generate the "Log service" variable. GENR lserv=LOG(Months) * An unrestricted model MLE Acc B C D E p6569 p7074 p7579 c7579 lserv / TYPE=EPOISSON COEF=BETA * The results reported in the first column of Table 19.18, p. 882 * impose the restriction of 1 for the coefficient of lserv. * (See Footnote 61, p. 881 for explanation about this restriction). * The NL command is used below to estimate the Poisson regression * model with restrictions. * The LGAM(x) function with the GENR command generates a log gamma function. GENR CONST = LGAM(Acc+1) GEN1 BETA:9=BETA:10 * Estimation of a Poisson regression model by maximum likelihood. * Specify the log-density for a single observation based on the * formula for lnL on p. 880. XB: (B1*B+B2*C+B3*D+B4*E+B5*p6569+B6*p7074+B7*p7579+B8*c7579+lserv+B0) NL 1 / NCOEF=9 LOGDEN START=BETA EQ -EXP([XB])+ & Acc*[XB] - CONST END STOP