. . * This STATA program reads in data and gives summary statistics and Poisson a > nd . * negative binomial models for the doctor visits studied in . * Chapter 3 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. . * At this stage it gives Table 3.2 and the first two columns of Table 3.3 . * The book instead used Limdep and a fuller Limdep program is available . . * To run you need file . * racd3.asc . * in your directory . . ********** DATA DESCRIPTION . * . * The data set racd3.asc is the same data as originally used in . * (1) A.C. Cameron and P.K. Trivedi (1986), "Econometric Models Based on . * Count Data: Comparisons and Applications of Some Estimators and Tests", . * Journal of Applied Econometrics, Vol. 1, pp. 29-54. . * and in Table 4 . * (2) A.C. Cameron, P.K. Trivedi, F. Milne and J. Piggott (1988), . * "A Microeconometric Model of the Demand for Health Care and Health . * Insurance in Australia", Review of Economic Studies, Vol.55, pp. 85-106. . * though in places this paper used more variables than those here . * and in . * (3) A.C. Cameron, P.K. Trivedi (1993), . * "Tests of Independence in Parametric Models with Applications and . * Illustrations", Journal of Business & Economics Statistics, . * Vol.11, pp.29-43. . * and in a number of other subsequent papers. . . * This data is not a representative sample of Australians as it oversamples . * young and old. In particular, use of health services may be overstated. . * This is because while the original sample of 40,650 individuals . * from the 1977-78 Australian Health Survey is representative, . * the sample used here is restricted to single people over 18 years of age. . . * See the R.E.Stud. (1988, pp.85-106) section 3 for more detailed . * discussion of the data than that given in the RACD book. . . * The regressors are defined in RACD on page 68 . * Socioeconomic: . * SEX 1 if female, 0 if male . * AGE Age in years divided by 100 . * (measured as mid-point of 10 age groups from 15-19 years to . * 65-69 with 70 or more coded treated as 72) . * AGESQ AGE squared . * INCOME Annual income in Australian dollars divided by 1000 . * (measured as mid-point of coded ranges Nil, <200, 200-1000, . * 1001-, 2001-, 3001-, 4001-, 5001-, 6001-, 7001-, 8001-10000, . * 10001-12000, 12001-14000, with 14001- treated as 15000 . * Health insurance: . * LEVYPLUS 1 if covered by private health insurance fund for private . * patient in public hospital (with doctor of choice), 0 otherwis . * FREEPOOR 1 if covered by government because low income, recent immigran . * unemployed, 0 otherwise . * FREEREPA 1 if covered free by government because of old-age or disabili . * pension, or because invalid veteran or family of deceased . * veteran, 0 otherwise . * (Omitted category LEVY is 1 if covered by Medibank health insurance) . * Health status: . * ILLNESS Number of illnesses in past 2 weeks with 5 or more coded as 5 . * ACTDAYS Number of days of reduced activity in past two weeks due to . * illness or injury . * HSCORE General health questionnaire score using Goldberg's method. . * High score indicates bad health. . * CHCOND1 1 if chronic condition(s) but not limited in activity, 0 other . * CHCOND2 1 if chronic condition(s) and limited in activity, 0 otherwise . . * Note that the R.E.Stud. (1988) article uses different names: . * FREEREPA was called FREEOTHER . * HSCORE was called GHQ . * CHCOND1 was called LIMCHRON . * CHCOND2 was called NONLIMCHRON . . * The count variables are defined in R.E.Stud. (1988, pp.91) . * DVISITS Number of consultations with a doctor or specialist . * in the past 2 weeks . * (same as DOCTORCON in R.E.Stud. (1988) . * and NOCNSLT in J.A.E.(1986)) . * NONDOCCO Number of consultations with non-doctor health professionals . * (chemist, optician, physiotherapist, social worker, . * district community nurse, chiropodist or chiropractor) . * in the past 2 weeks . * HOSPADMI Number of admissions to a hospital, psychiatric hospital, . * nursing or convalescent home in the past 12 months . * (up to 5 or more admissions which is coded as 5) . * HOSPDAYS Number of nights in a hospital, etc. during most recent . * admission: taken, where appropriate, as the mid-point of the . * intervals 1, 2, 3, 4, 5, 6, 7, 8-14, 15-30, 31-60, 61-79 . * with 80 or more admissions coded as 80. If no admission . * in past 12 months then equals zero. . * MEDICINE Total number of prescribed and nonprescribed medications used . * in past 2 days . * PRESCRIB Total number of prescribed medications used in past 2 days . * NONPRESC Total number of nonprescribed medications used in past 2 days . . ********** CREATE OUTPUT FILE . * . di "racd3p4.do for Cameron and Trivedi RACD chapter 3" racd3p4.do for Cameron and Trivedi RACD chapter 3 . . ********** READ DATA . * . * The data are in ascii file racd6d1.asc . * There are 5190 observations on 20 variables with one lines per obs . * The format is F3.0,F5.2,F7.4,F5.2,12F4.0,4F3.0 . * but since there is a blank between each observation it can be read in free > format. . . infile SEX AGE AGESQ INCOME LEVYPLUS FREEPOOR FREEREPA ILLNESS ACTDAYS HSCORE > /* > */ CHCOND1 CHCOND2 DVISITS NONDOCCO HOSPADMI HOSPDAYS MEDICINE PRESCRIB > /* > */ NONPRESC CONSTANT using racd3.asc (5190 observations read) . . ********** DATA TRANSFORMATIONS . * . . ******** CHECK DATA: DESCRIPTIVE STATISTICS . * . describe Contains data obs: 5,190 vars: 20 size: 435,960 (57.4% of memory free) ------------------------------------------------------------------------------- 1. SEX float %9.0g 2. AGE float %9.0g 3. AGESQ float %9.0g 4. INCOME float %9.0g 5. LEVYPLUS float %9.0g 6. FREEPOOR float %9.0g 7. FREEREPA float %9.0g 8. ILLNESS float %9.0g 9. ACTDAYS float %9.0g 10. HSCORE float %9.0g 11. CHCOND1 float %9.0g 12. CHCOND2 float %9.0g 13. DVISITS float %9.0g 14. NONDOCCO float %9.0g 15. HOSPADMI float %9.0g 16. HOSPDAYS float %9.0g 17. MEDICINE float %9.0g 18. PRESCRIB float %9.0g 19. NONPRESC float %9.0g 20. CONSTANT float %9.0g ------------------------------------------------------------------------------- Sorted by: Note: dataset has changed since last saved . summarize Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- SEX | 5190 .5206166 .4996229 0 1 AGE | 5190 .4063854 .2047818 .19 .72 AGESQ | 5190 .2070766 .1856365 .0361 .5184 INCOME | 5190 .5831599 .3689067 0 1.5 LEVYPLUS | 5190 .4427746 .4967623 0 1 FREEPOOR | 5190 .0427746 .202368 0 1 FREEREPA | 5190 .2102119 .4074983 0 1 ILLNESS | 5190 1.431985 1.384152 0 5 ACTDAYS | 5190 .8618497 2.887628 0 14 HSCORE | 5190 1.217534 2.124266 0 12 CHCOND1 | 5190 .4030829 .4905644 0 1 CHCOND2 | 5190 .1165703 .3209385 0 1 DVISITS | 5190 .3017341 .7981338 0 9 NONDOCCO | 5190 .2146435 .9652756 0 11 HOSPADMI | 5190 .1736031 .5075236 0 5 HOSPDAYS | 5190 1.333719 6.120081 0 80 MEDICINE | 5190 1.218304 1.556643 0 8 PRESCRIB | 5190 .8626204 1.415375 0 8 NONPRESC | 5190 .355684 .712389 0 8 CONSTANT | 5190 1 0 1 1 . . ******** SAVE DATA AS STATA DATA SET . * . * save racd3p4, replace . . . ********** POISSON REGRESSION . * . poisson DVISITS SEX AGE AGESQ INCOME LEVYPLUS FREEPOOR FREEREPA ILLNESS ACTDA > YS HSCORE /* > */ CHCOND1 CHCOND2 Iteration 0: log likelihood = -4923.1976 Iteration 1: log likelihood = -3890.2934 Iteration 2: log likelihood = -3356.8559 Iteration 3: log likelihood = -3355.5431 Iteration 4: log likelihood = -3355.5413 Iteration 5: log likelihood = -3355.5413 Poisson regression Number of obs = 5190 LR chi2(12) = 1255.31 Prob > chi2 = 0.0000 Log likelihood = -3355.5413 Pseudo R2 = 0.1576 ------------------------------------------------------------------------------ DVISITS | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- SEX | .156882 .0561368 2.795 0.005 .0468558 .2669081 AGE | 1.056299 1.000781 1.055 0.291 -.9051946 3.017794 AGESQ | -.8487041 1.077785 -0.787 0.431 -2.961123 1.263715 INCOME | -.2053206 .0883793 -2.323 0.020 -.3785409 -.0321003 LEVYPLUS | .1231854 .0716398 1.720 0.086 -.0172261 .2635969 FREEPOOR | -.4400609 .1798115 -2.447 0.014 -.792485 -.0876369 FREEREPA | .0797984 .0920603 0.867 0.386 -.1006364 .2602333 ILLNESS | .1869484 .0182805 10.227 0.000 .1511192 .2227776 ACTDAYS | .1268465 .005034 25.198 0.000 .1169801 .1367129 HSCORE | .030081 .0100994 2.979 0.003 .0102866 .0498754 CHCOND1 | .1140853 .0666396 1.712 0.087 -.0165258 .2446964 CHCOND2 | .1411583 .0831451 1.698 0.090 -.0218032 .3041197 _cons | -2.223848 .1898161 -11.716 0.000 -2.595881 -1.851815 ------------------------------------------------------------------------------ . . ********** CLOSE OUTPUT . log close