* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapter 16.6.3 Poisson Regression SAMPLE 1 1610 * Note: In the data file missing values are coded as -99999 READ (olympics.dat) / names * The SET SKIPMISS command turns on the automatic deletion of * missing observations from estimation commands. SET SKIPMISS NOWARNMISS NOWARNSKIP * Summary Statistics STAT / ALL * Work with data for the year 1988. SKIPIF (YEAR.NE.88) * Calculate and list medians STAT pop gdp / MEDIAN=med PRINT med GENR lnpop=LOG(pop) GENR lngdp=LOG(gdp) GEN1 m1=LOG(med:1) GEN1 m2=LOG(med:2) * A model of medal totals at the Olympic Games * Estimation - Table 16.6, page 614 ML medaltot lnpop lngdp / TYPE=EPOISSON COEF=B * Predict the number of medals won for a country with median * population and median GDP. * On the TEST command the variable names represent the coefficients. TEST exp(constant + lnpop*m1 + lngdp*m2) * Check the calculation done by the TEST commnad GEN1 medal = exp(B:1*LOG(med:1) + B:2*LOG(med:2) + B:3) PRINT medal STOP