. . * This STATA program reads in data and gives summary statistics and Poisson a > nd . * negative binomial models for the recreational trips data studined in . * Chapter 6.4-6.5 and Chapter 12.6 of . * A.C. Cameron and Pravin K. Trivedi (1998), . * REGRESSION ANALYSIS OF COUNT DATA, . * Econometric Society Monograph No.30, Cambridge University Press. . . * The program does only a small part of the analysis in the book. . . * To run you need file . * racd6d2.asc . * in your directory . . ********** DATA DESCRIPTION . * . * A detailed discussion of the variables can be found in . * C. Sellar, J.R. Stoll and J.P. Chavas (1985), . * "Validation of Empirical Measures of Welfare Change: A Comparison of nonmar > ket . * Techniques," Land Economics, 61, 156-175. . * Data used with permission of Sellar et al. (1985) . * And also T. Ozuna and I. Gomaz (1995) . * "Specification and Testing of Count Data Recreation Demand Functions," . * Empirical Economics, 20, 543-550. . . * The analysis of these data in the count data book is based on . * S. Gurmu and P.K. Trivedi (1996) . * "Excess Zeros in Count Data Models for Recreational Trips" . * Journal of Business and Economics Statistics, 14, 469-477. . * "Multiple Bids as a Consequence of Target Management Resistance" . . * 1: Number of boating trips to Lake Somerville, East Texas, in 1980 (TRIPS > or V3) . * 2: Facility's subjective quality ranking (SO) . * 3: Respondent's taste for water-skiing (SKI) . * 4: Income - categorical variable (I) . * 5: Cost dummy variable; 1 if an annual user fee is paid at Lake somerville > (FC3) . * 6: Travel cost to Lake Conroe (C1) . * 7: Travel cost to Lake Somerville (C3) . * 8: Travel cost to Lake Houston (C4) . . ********** CREATE OUTPUT FILE . * . di "racd6p2.do for Cameron and Trivedi RACD chapters 6.4-6.5 and 12.6" racd6p2.do for Cameron and Trivedi RACD chapters 6.4-6.5 and 12.6 . . ********** READ DATA . * . * The Recreational trips data are in ascii file racd6d2.asc . * There are 659 observations on 8 variables with one lines per obs . * The data are fixed format with . * line 1 variables 1-8 5F7.0,3F11.0 . . infile TRIPS SO SKI I FC3 C1 C3 C4 using racd6d2.asc (659 observations read) . . ********** DATA TRANSFORMATIONS . * . . ******** CHECK DATA: DESCRIPTIVE STATISTICS . * . describe Contains data obs: 659 vars: 8 size: 23,724 (97.6% of memory free) ------------------------------------------------------------------------------- 1. TRIPS float %9.0g 2. SO float %9.0g 3. SKI float %9.0g 4. I float %9.0g 5. FC3 float %9.0g 6. C1 float %9.0g 7. C3 float %9.0g 8. C4 float %9.0g ------------------------------------------------------------------------------- Sorted by: Note: dataset has changed since last saved . summarize Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- TRIPS | 659 2.24431 6.292475 0 88 SO | 659 1.418816 1.811986 0 5 SKI | 659 .3672231 .4824142 0 1 I | 659 3.852807 1.851937 1 9 FC3 | 659 .0197269 .1391657 0 1 C1 | 659 55.4237 46.68265 4.34 493.77 C3 | 659 59.92805 46.37668 4.767 491.547 C4 | 659 55.9903 46.13321 5.7 491.049 . . ******** SAVE DATA AS STATA DATA SET . * . * save racd6d2, replace . . . ********** POISSON REGRESSION . * . poisson TRIPS SO SKI I FC3 C1 C3 C4 Iteration 0: log likelihood = -2866.625 Iteration 1: log likelihood = -1811.5015 Iteration 2: log likelihood = -1536.5136 Iteration 3: log likelihood = -1529.4565 Iteration 4: log likelihood = -1529.4313 Iteration 5: log likelihood = -1529.4313 Poisson regression Number of obs = 659 LR chi2(7) = 2543.90 Prob > chi2 = 0.0000 Log likelihood = -1529.4313 Pseudo R2 = 0.4540 ------------------------------------------------------------------------------ TRIPS | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- SO | .4717259 .0170905 27.602 0.000 .4382291 .5052227 SKI | .4182137 .0571905 7.313 0.000 .3061224 .5303051 I | -.1113232 .0195885 -5.683 0.000 -.1497159 -.0729304 FC3 | .8981652 .0789854 11.371 0.000 .7433567 1.052974 C1 | -.0034297 .0031178 -1.100 0.271 -.0095405 .0026811 C3 | -.0425364 .0016703 -25.466 0.000 -.0458102 -.0392626 C4 | .0361336 .0027096 13.335 0.000 .0308229 .0414444 _cons | .2649934 .0937224 2.827 0.005 .0813009 .4486859 ------------------------------------------------------------------------------ . nbreg TRIPS SO SKI I FC3 C1 C3 C4 Fitting comparison Poisson model: Iteration 0: log likelihood = -2866.625 Iteration 1: log likelihood = -1811.5015 Iteration 2: log likelihood = -1536.5136 Iteration 3: log likelihood = -1529.4565 Iteration 4: log likelihood = -1529.4313 Iteration 5: log likelihood = -1529.4313 Fitting constant-only model: Iteration 0: log likelihood = -1320.5971 Iteration 1: log likelihood = -1065.6673 Iteration 2: log likelihood = -1064.723 Iteration 3: log likelihood = -1064.7225 Iteration 4: log likelihood = -1064.7225 Fitting full model: Iteration 0: log likelihood = -950.47094 Iteration 1: log likelihood = -846.53401 Iteration 2: log likelihood = -832.19295 Iteration 3: log likelihood = -825.60486 Iteration 4: log likelihood = -825.55761 Iteration 5: log likelihood = -825.55758 Negative binomial regression Number of obs = 659 LR chi2(7) = 478.33 Prob > chi2 = 0.0000 Log likelihood = -825.55758 Pseudo R2 = 0.2246 ------------------------------------------------------------------------------ TRIPS | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- SO | .721999 .0453323 15.927 0.000 .6331493 .8108486 SKI | .6121387 .1504163 4.070 0.000 .3173282 .9069492 I | -.0260589 .0452342 -0.576 0.565 -.1147163 .0625986 FC3 | .6691678 .3614399 1.851 0.064 -.0392413 1.377577 C1 | .0480086 .0159516 3.010 0.003 .016744 .0792732 C3 | -.092691 .0082685 -11.210 0.000 -.1088969 -.0764851 C4 | .0388357 .0117139 3.315 0.001 .015877 .0617945 _cons | -1.121936 .2208284 -5.081 0.000 -1.554752 -.6891203 ---------+-------------------------------------------------------------------- /lnalpha | .3157291 .1060209 2.978 0.003 .1079319 .5235262 ---------+-------------------------------------------------------------------- alpha | 1.371259 .1453821 1.113972 1.687969 ------------------------------------------------------------------------------ Likelihood ratio test of alpha=0: chi2(1) = 1407.75 Prob > chi2 = 0.0000 . . ********** CLOSE OUTPUT . log close