. di "racd9p6.do by Colin Cameron: Stata panel regression example" racd9p6.do by Colin Cameron: Stata panel regression example . . ********** DESCRIPTION . * . * This program uses Stata to do panel data analysis for chapter 9 p.308-9 . * A.C. Cameron and Pravin K. Trivedi (1998), . * REGRESSION ANALYSIS OF COUNT DATA, . * Econometric Society Monograph No.30, Cambridge University Press. . . * In the book only fixed effects estimates are given. . * Here random effects estimates are also given for several models, . * all with current and lagged R&D and varying according to . * Plus - time-invariant regressors and constant . * - constant . * - time-invariant regressors and no constant . * - no constant . . * The Stata program here is unsuccessful in estimating random effects with ti > me invariant regressors . . * The Stata results here are the same as Gauss programs racd9p5.gau . * which estimates random effects with no constant and no time-invariane regre > ssors . . * The Stata program here gives same results as Limdep for Poisson FE and RE . * and different results to Limdep for negative binomial FE and RE . * (which suggests Limdep is wrong since Gauss gives same results as Stata) . . * ERRATA: Columns 1 and 2 of RACD Table 9.1 p.309 are wrong . * Correct answers given below. . . * To run you need file . * racd9d2.asc . * in your directory . . ********** DATA DESCRIPTION . * . * The original data is from . * Bronwyn Hall, Zvi Griliches, and Jerry Hausman (1986), . * "Patents and R&D: Is There a Lag?", . * International Economic Review, 27, 265-283. . . * File racd9d2.asc (same as patr7079.dat) has data on 346 firms . * There are 4 lines per firm, with 25 variables . * Time-invariant: CUSIP,ARDSSIC,SCISECT,LOGK,SUMPAT, . * Time-varying X: LOGR70,LOGR71,LOGR72, ....., LOGR77,LOGR78,LOGR79 . * Time-varying Y: PAT70,PAT71,PAT72, ....., PAT77,PAT78,PAT79 . * in the format: . * I7,I3,I2,5F12.6/6F12.6/6F12.6/5F12.6/ . * where . * CUSIP Compustat's identifying number for the firm (Committee on . * Uniform Security Identification Procedures number). . * ARDSIC A two-digit code for the applied R&D industrial classification . * (roughly that in Bound, Cummins, Griliches, Hall, and Jaffe, in . * the Griliches R&D, Patents, and Productivity volume). . * SCISECT Dummy equal to one for firms in the scientific sector. . * LOGK The logarithm of the book value of capital in 1972. . * SUMPAT The sum of patents applied for between 1972-1979. . * LOGR70- The logarithm of R&D spending during the year (in 1972 dollars). . * LOGR79 . * PAT70- The number of patents applied for during the year that were . * PAT79 eventually granted. . . * In the RACD book chapter 9 pages 308-9 . * SCISECT is called DSCI . * LOGK is called Ln size . . . ********** MEMORY MANAGEMENT . * . set maxvar 100 width 1000 (maxvar and maxobs no longer need be set with this version of Stata) . * If need more memory then in Stata give command help memory . . . ********** READ DATA . * . * The data are in ascii file racd9d2.asc . * This is a data set of 1730 lines (5 lines for each firm) with 18 variables . * OBSNO,YEAR,CUSIP,ARDSSIC,SCISECT,LOGK,SUMPAT . * PAT,PAT1,PAT2,PAT3,PAT4 . * LOGR,LOGR1,LOGR2,LOGR3,LOGR4,LOGR5 . * . * Read in using Infile: FREE FORMAT WITHOUT DICTIONARY . * As there is space between each observation data is also space-delimited . * free format and then there is no need for a dictionary file . * The following command spans more that one line so use /* and */ . . infile OBSNO YEAR CUSIP ARDSSIC SCISECT LOGK SUMPAT PAT PAT1 /* > */ PAT2 PAT3 PAT4 LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 using racd9d2.asc (1730 observations read) . . gen id = OBSNO . label variable id "id" . gen dyear2 = 0 . replace dyear2 = 1 if YEAR == 2 (346 real changes made) . gen dyear3 = 0 . replace dyear3 = 1 if YEAR == 3 (346 real changes made) . gen dyear4 = 0 . replace dyear4 = 1 if YEAR == 4 (346 real changes made) . gen dyear5 = 0 . replace dyear5 = 1 if YEAR == 5 (346 real changes made) . . describe Contains data obs: 1,730 vars: 23 size: 166,080 (83.7% of memory free) ------------------------------------------------------------------------------- 1. OBSNO float %9.0g 2. YEAR float %9.0g 3. CUSIP float %9.0g 4. ARDSSIC float %9.0g 5. SCISECT float %9.0g 6. LOGK float %9.0g 7. SUMPAT float %9.0g 8. PAT float %9.0g 9. PAT1 float %9.0g 10. PAT2 float %9.0g 11. PAT3 float %9.0g 12. PAT4 float %9.0g 13. LOGR float %9.0g 14. LOGR1 float %9.0g 15. LOGR2 float %9.0g 16. LOGR3 float %9.0g 17. LOGR4 float %9.0g 18. LOGR5 float %9.0g 19. id float %9.0g id 20. dyear2 float %9.0g 21. dyear3 float %9.0g 22. dyear4 float %9.0g 23. dyear5 float %9.0g ------------------------------------------------------------------------------- Sorted by: Note: dataset has changed since last saved . summarize Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- OBSNO | 1730 173.5 99.91006 1 346 YEAR | 1730 3 1.414622 1 5 CUSIP | 1730 531201.2 281748.4 800 989399 ARDSSIC | 1730 -19.18497 169.1684 -999 21 SCISECT | 1730 .4248555 .494464 0 1 LOGK | 1730 3.921063 2.093117 -1.76965 9.66626 SUMPAT | 1730 284.7312 570.4526 0 3806 PAT | 1730 34.77168 70.87538 0 515 PAT1 | 1730 35.87341 72.76243 0 528 PAT2 | 1730 36.70289 75.12335 0 595 PAT3 | 1730 36.7185 75.52676 0 595 PAT4 | 1730 37.1711 76.53968 0 595 LOGR | 1730 1.256163 2.006314 -3.84868 7.03432 LOGR1 | 1730 1.233574 1.984091 -3.84868 7.06524 LOGR2 | 1730 1.218499 1.966808 -3.84868 7.06524 LOGR3 | 1730 1.205683 1.951968 -3.84868 7.06524 LOGR4 | 1730 1.196941 1.942034 -3.67395 7.06524 LOGR5 | 1730 1.203451 1.934293 -3.67395 7.06524 id | 1730 173.5 99.91006 1 346 dyear2 | 1730 .2 .4001157 0 1 dyear3 | 1730 .2 .4001157 0 1 dyear4 | 1730 .2 .4001157 0 1 dyear5 | 1730 .2 .4001157 0 1 . . /***** CROSS_SECTION MODELS *****/ . . * (0) Poisson Cross-section with Poisson standard errors . poisson PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LO > GK SCISECT Iteration 0: log likelihood = -17836.658 Iteration 1: log likelihood = -17834.138 Iteration 2: log likelihood = -17834.138 Poisson regression Number of obs = 1730 LR chi2(12) = 114872.65 Prob > chi2 = 0.0000 Log likelihood = -17834.138 Pseudo R2 = 0.7631 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .1345243 .0307183 4.379 0.000 .0743177 .194731 LOGR1 | -.052944 .0427972 -1.237 0.216 -.136825 .030937 LOGR2 | .0082291 .0397845 0.207 0.836 -.069747 .0862052 LOGR3 | .0660973 .0369686 1.788 0.074 -.0063598 .1385544 LOGR4 | .090181 .0333362 2.705 0.007 .0248434 .1555187 LOGR5 | .2395385 .0224598 10.665 0.000 .1955182 .2835589 dyear2 | -.0435152 .0131209 -3.316 0.001 -.0692318 -.0177986 dyear3 | -.0524413 .0132876 -3.947 0.000 -.0784844 -.0263981 dyear4 | -.1702422 .0135298 -12.583 0.000 -.19676 -.1437243 dyear5 | -.2018787 .0135335 -14.917 0.000 -.2284039 -.1753535 LOGK | .2528625 .0044143 57.283 0.000 .2442108 .2615143 SCISECT | .4543096 .0092423 49.155 0.000 .4361949 .4724242 _cons | .8099099 .0211886 38.224 0.000 .7683811 .8514387 ------------------------------------------------------------------------------ . poisson PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 Iteration 0: log likelihood = -19892.75 Iteration 1: log likelihood = -19892.686 Iteration 2: log likelihood = -19892.686 Poisson regression Number of obs = 1730 LR chi2(10) = 110755.56 Prob > chi2 = 0.0000 Log likelihood = -19892.686 Pseudo R2 = 0.7357 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .1525101 .0293891 5.189 0.000 .0949085 .2101117 LOGR1 | .0219814 .040827 0.538 0.590 -.058038 .1020008 LOGR2 | .0436899 .0380245 1.149 0.251 -.0308367 .1182165 LOGR3 | .0827156 .0356778 2.318 0.020 .0127885 .1526427 LOGR4 | .103971 .0317574 3.274 0.001 .0417276 .1662145 LOGR5 | .3010911 .0206311 14.594 0.000 .260655 .3415273 dyear2 | -.0439915 .0132019 -3.332 0.001 -.0698668 -.0181162 dyear3 | -.0604323 .0134311 -4.499 0.000 -.0867568 -.0341079 dyear4 | -.1892463 .0136836 -13.830 0.000 -.2160657 -.162427 dyear5 | -.2297899 .0136341 -16.854 0.000 -.2565122 -.2030677 _cons | 1.828308 .0125346 145.861 0.000 1.80374 1.852875 ------------------------------------------------------------------------------ . poisson PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LO > GK SCISECT, noconstant Iteration 0: log likelihood = -65127.755 Iteration 1: log likelihood = -26151.28 Iteration 2: log likelihood = -18567.168 Iteration 3: log likelihood = -18529.182 Iteration 4: log likelihood = -18529.165 Iteration 5: log likelihood = -18529.165 Poisson regression Number of obs = 1730 Wald chi2(12) = 1331824.82 Log likelihood = -18529.165 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .0539799 .0325932 1.656 0.098 -.0099017 .1178614 LOGR1 | .0292292 .0459551 0.636 0.525 -.0608411 .1192995 LOGR2 | .017243 .0424782 0.406 0.685 -.0660127 .1004988 LOGR3 | .0327096 .0391336 0.836 0.403 -.0439908 .1094101 LOGR4 | .0408678 .0355352 1.150 0.250 -.0287798 .1105154 LOGR5 | .2406579 .0242126 9.939 0.000 .1932022 .2881136 dyear2 | .1074081 .012915 8.317 0.000 .0820953 .132721 dyear3 | .1037728 .0130252 7.967 0.000 .0782438 .1293018 dyear4 | -.0138082 .013263 -1.041 0.298 -.0398032 .0121869 dyear5 | -.0473264 .0132994 -3.559 0.000 -.0733928 -.0212601 LOGK | .3796013 .0028542 132.999 0.000 .3740072 .3851954 SCISECT | .6354614 .008104 78.413 0.000 .6195779 .651345 ------------------------------------------------------------------------------ . poisson PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, n > oconstant Iteration 0: log likelihood = -66997.996 Iteration 1: log likelihood = -32401.779 Iteration 2: log likelihood = -28072.945 Iteration 3: log likelihood = -28041.857 Iteration 4: log likelihood = -28041.843 Iteration 5: log likelihood = -28041.843 Poisson regression Number of obs = 1730 Wald chi2(10) = 1345136.86 Log likelihood = -28041.843 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | -.5595848 .0344075 -16.263 0.000 -.6270223 -.4921472 LOGR1 | 1.101211 .0511123 21.545 0.000 1.001033 1.201389 LOGR2 | .1667484 .0478651 3.484 0.000 .0729346 .2605623 LOGR3 | -.0323489 .0425991 -0.759 0.448 -.1158416 .0511439 LOGR4 | -.2014358 .0390269 -5.161 0.000 -.2779271 -.1249445 LOGR5 | .4198256 .0257748 16.288 0.000 .3693078 .4703433 dyear2 | 1.024041 .0129701 78.954 0.000 .99862 1.049462 dyear3 | 1.029641 .0131196 78.481 0.000 1.003927 1.055355 dyear4 | .8696576 .0136843 63.551 0.000 .8428368 .8964784 dyear5 | .7752602 .0140814 55.056 0.000 .7476612 .8028591 ------------------------------------------------------------------------------ . . /***** COUNT DATA PANEL MODELS *****/ . . /* FIXED EFFECTS */ . . * (1) Poisson fixed effects . xtpois PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, fe > i(id) Note: 22 groups dropped (110 obs) due to all zero outcomes Fitting comparison model: Iteration 0: log likelihood = -72004.049 Iteration 1: log likelihood = -38734.617 Iteration 2: log likelihood = -27899.083 Iteration 3: log likelihood = -27885.128 Iteration 4: log likelihood = -27885.124 Iteration 5: log likelihood = -27885.124 Fitting full model: Iteration 0: log likelihood = -7971.0843 Iteration 1: log likelihood = -4758.5312 Iteration 2: log likelihood = -3536.5918 Iteration 3: log likelihood = -3536.3086 Iteration 4: log likelihood = -3536.3086 Conditional fixed-effects poisson Number of obs = 1620 Group variable (i) : id Number of groups = 324 Obs per group: min = 5 avg = 5.0 max = 5 LR chi2(10) = 48697.63 Log likelihood = -3536.3086 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .3222105 .0459412 7.014 0.000 .2321674 .4122535 LOGR1 | -.0871295 .0486887 -1.790 0.074 -.1825576 .0082986 LOGR2 | .0785816 .044784 1.755 0.079 -.0091934 .1663567 LOGR3 | .00106 .0414151 0.026 0.980 -.0801122 .0822322 LOGR4 | -.0046414 .0378489 -0.123 0.902 -.0788238 .0695411 LOGR5 | .0026068 .0322596 0.081 0.936 -.0606209 .0658346 dyear2 | -.0426076 .013132 -3.245 0.001 -.0683458 -.0168695 dyear3 | -.0400462 .0134677 -2.974 0.003 -.0664423 -.01365 dyear4 | -.1571185 .0142281 -11.043 0.000 -.1850051 -.1292319 dyear5 | -.1980306 .0152946 -12.948 0.000 -.2280074 -.1680538 ------------------------------------------------------------------------------ . . * (2) Negative binomial fixed effects . xtnbreg PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, f > e i(id) Fitting comparison model: Iteration 0: log likelihood = -66997.996 Iteration 1: log likelihood = -32401.779 Iteration 2: log likelihood = -28072.945 Iteration 3: log likelihood = -28041.857 Iteration 4: log likelihood = -28041.843 Iteration 5: log likelihood = -28041.843 Iteration 0: log likelihood = -6121.3411 Iteration 1: log likelihood = -6002.9016 Iteration 2: log likelihood = -5994.3784 Iteration 3: log likelihood = -5994.3376 Iteration 4: log likelihood = -5994.3376 Fitting full model: Iteration 0: log likelihood = -5392.1362 (not concave) Iteration 1: log likelihood = -4420.4794 Iteration 2: log likelihood = -3505.6269 Iteration 3: log likelihood = -3413.1984 Iteration 4: log likelihood = -3392.7344 Iteration 5: log likelihood = -3391.3575 Iteration 6: log likelihood = -3391.3539 Iteration 7: log likelihood = -3391.3539 Conditional fixed-effects negative binomial Number of obs = 1730 Group variable (i) : id Number of groups = 346 Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(10) = 1502.81 Log likelihood = -3391.3539 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .3632355 .0854094 4.253 0.000 .1958361 .5306349 LOGR1 | .1555262 .0988315 1.574 0.116 -.03818 .3492324 LOGR2 | .1740148 .0902354 1.928 0.054 -.0028433 .3508729 LOGR3 | .0148527 .0828302 0.179 0.858 -.1474916 .177197 LOGR4 | .0287584 .0755873 0.380 0.704 -.1193901 .1769068 LOGR5 | .1360577 .0615476 2.211 0.027 .0154266 .2566888 dyear2 | .0264623 .0281838 0.939 0.348 -.0287769 .0817016 dyear3 | .0021121 .0288493 0.073 0.942 -.0544316 .0586558 dyear4 | -.1378216 .0299147 -4.607 0.000 -.1964534 -.0791898 dyear5 | -.192958 .0301083 -6.409 0.000 -.2519692 -.1339467 ------------------------------------------------------------------------------ . . /* RANDOM EFFECTS > > These are done in four ways > - with the time-invariant regressors and intercept (LOGK which is ln(SIE) > and SCISECT which is DSCI) > - with the intercept but otherwise no time-invariant regressors > - with the time-invariant regressors and no intercept (LOGK which is ln(SI > E) and SCISECT which is DSCI) > - without the intercept (so can then compare with the Gauss results from r > acd9p5.gau) */ . . * (3A) Poisson random effects with constant & time invariant regressors . xtpois PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LOG > K SCISECT, re i(id) Fitting comparison model: Iteration 0: log likelihood = -17836.658 Iteration 1: log likelihood = -17834.138 Iteration 2: log likelihood = -17834.138 Fitting constant-only model: Iteration 0: log likelihood = -75270.145 (not concave) Iteration 1: log likelihood = -10666.1 Iteration 2: log likelihood = -10666.1 (backed up) Fitting full model: Iteration 0: log likelihood = -10666.1 Iteration 1: log likelihood = -10666.1 (backed up) Random-effects poisson Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Gamma Obs per group: min = 5 avg = 5.0 max = 5 LR chi2(12) = 0.00 Log likelihood = -10666.1 Prob > chi2 = 1.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | 7.95e-08 .0455177 0.000 1.000 -.0892129 .0892131 LOGR1 | -1.92e-08 .0490156 0.000 1.000 -.0960687 .0960687 LOGR2 | 2.01e-08 .0447757 0.000 1.000 -.0877588 .0877589 LOGR3 | 1.68e-09 .0414123 0.000 1.000 -.0811665 .0811665 LOGR4 | -7.48e-10 .0379936 0.000 1.000 -.0744661 .0744661 LOGR5 | 2.31e-09 .0323265 0.000 1.000 -.0633588 .0633588 dyear2 | -1.06e-08 .0134059 0.000 1.000 -.0262751 .0262751 dyear3 | -1.02e-08 .0137795 0.000 1.000 -.0270073 .0270072 dyear4 | -3.82e-08 .0142247 0.000 1.000 -.02788 .0278799 dyear5 | -4.79e-08 .0151464 0.000 1.000 -.0296864 .0296863 LOGK | .9782396 80.55974 0.012 0.990 -156.9159 158.8724 SCISECT | 1.228606 368.7124 0.003 0.997 -721.4344 723.8916 _cons | -3.49543 326.027 -0.011 0.991 -642.4966 635.5057 ---------+-------------------------------------------------------------------- /invln_a | -1924.154 107.6683 -17.871 0.000 -2135.18 -1713.128 ---------+-------------------------------------------------------------------- alpha | . . . . ------------------------------------------------------------------------------ Likelihood ratio test of alpha=0: chi2(1) = 14336.08 Prob > chi2 = 0.0000 . . * (3B) Poisson random effects with constant . xtpois PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, re > i(id) Fitting comparison model: Iteration 0: log likelihood = -19892.75 Iteration 1: log likelihood = -19892.686 Iteration 2: log likelihood = -19892.686 Fitting constant-only model: Iteration 0: log likelihood = -75270.145 (not concave) Iteration 1: log likelihood = -10666.1 Iteration 2: log likelihood = -10666.1 (backed up) Fitting full model: Iteration 0: log likelihood = -10666.1 Iteration 1: log likelihood = -10665.973 (backed up) Iteration 2: log likelihood = -10665.957 (backed up) Iteration 3: log likelihood = -10665.953 (backed up) Iteration 4: log likelihood = -5606.2504 (backed up) Iteration 5: log likelihood = -5387.326 Iteration 6: log likelihood = -5285.4006 Iteration 7: log likelihood = -5263.7969 Iteration 8: log likelihood = -5263.6113 Iteration 9: log likelihood = -5263.6112 Random-effects poisson Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Gamma Obs per group: min = 5 avg = 5.0 max = 5 LR chi2(10) = 10804.98 Log likelihood = -5263.6112 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .476575 .042263 11.276 0.000 .393741 .5594089 LOGR1 | -.0077084 .047934 -0.161 0.872 -.1016573 .0862406 LOGR2 | .1364135 .0447339 3.049 0.002 .0487366 .2240904 LOGR3 | .0591909 .0412793 1.434 0.152 -.0217151 .1400969 LOGR4 | .0275177 .0376008 0.732 0.464 -.0461785 .1012139 LOGR5 | .0825466 .030977 2.665 0.008 .0218328 .1432605 dyear2 | -.0468786 .0131312 -3.570 0.000 -.0726152 -.0211419 dyear3 | -.056088 .0133621 -4.198 0.000 -.0822771 -.0298988 dyear4 | -.1903121 .0137889 -13.802 0.000 -.2173379 -.1632863 dyear5 | -.2526772 .0141972 -17.798 0.000 -.2805032 -.2248511 _cons | 1.402861 .0670521 20.922 0.000 1.271441 1.53428 ---------+-------------------------------------------------------------------- /invln_a | .1439743 .0815617 1.765 0.078 -.0158837 .3038322 ---------+-------------------------------------------------------------------- alpha | .86591 .0706251 .7379847 1.01601 ------------------------------------------------------------------------------ Likelihood ratio test of alpha=0: chi2(1) = 29258.15 Prob > chi2 = 0.0000 . . * (3C) Poisson random effects without constant & with time invariant regresso > rs . xtpois PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LOG > K SCISECT, noconstant re i(id) Fitting comparison model: Iteration 0: log likelihood = -65127.755 Iteration 1: log likelihood = -26151.28 Iteration 2: log likelihood = -18567.168 Iteration 3: log likelihood = -18529.182 Iteration 4: log likelihood = -18529.165 Iteration 5: log likelihood = -18529.165 Fitting full model: Iteration 0: log likelihood = -18529.038 (not concave) Iteration 1: log likelihood = -10631.117 Iteration 2: log likelihood = -10631.115 (backed up) Iteration 3: log likelihood = -10631.114 (backed up) Random-effects poisson Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Gamma Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(12) = 286.49 Log likelihood = -10631.114 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .0476361 .0455221 1.046 0.295 -.0415857 .1368579 LOGR1 | .0905679 .0486053 1.863 0.062 -.0046968 .1858326 LOGR2 | .0531098 .0449855 1.181 0.238 -.0350601 .1412798 LOGR3 | .1056158 .0418365 2.524 0.012 .0236178 .1876139 LOGR4 | .0768645 .0379637 2.025 0.043 .002457 .151272 LOGR5 | .2110401 .0320051 6.594 0.000 .1483113 .2737689 dyear2 | .0369962 .013246 2.793 0.005 .0110346 .0629579 dyear3 | .032315 .0135684 2.382 0.017 .0057215 .0589086 dyear4 | -.0850182 .0142938 -5.948 0.000 -.1130336 -.0570028 dyear5 | -.1245071 .0153698 -8.101 0.000 -.1546313 -.0943829 LOGK | .2040826 88.07398 0.002 0.998 -172.4177 172.8259 SCISECT | 2.595881 1678.523 0.002 0.999 -3287.249 3292.44 ---------+-------------------------------------------------------------------- /invln_a | -46763.21 109.7688 -426.016 0.000 -46978.36 -46548.07 ---------+-------------------------------------------------------------------- alpha | . . . . ------------------------------------------------------------------------------ Likelihood ratio test of alpha=0: chi2(1) = 15796.10 Prob > chi2 = 0.0000 . . * (3D) Poisson random effects without constant . xtpois PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, no > constant re i(id) Fitting comparison model: Iteration 0: log likelihood = -66997.996 Iteration 1: log likelihood = -32401.779 Iteration 2: log likelihood = -28072.945 Iteration 3: log likelihood = -28041.857 Iteration 4: log likelihood = -28041.843 Iteration 5: log likelihood = -28041.843 Fitting full model: Iteration 0: log likelihood = -28041.544 (not concave) Iteration 1: log likelihood = -11084.866 Iteration 2: log likelihood = -11067.263 (backed up) Iteration 3: log likelihood = -11066.193 (backed up) Iteration 4: log likelihood = -11065.66 (backed up) Iteration 5: log likelihood = -11065.393 (backed up) Iteration 6: log likelihood = -11065.26 (backed up) Iteration 7: log likelihood = -11065.193 (backed up) Iteration 8: log likelihood = -11065.177 (backed up) Iteration 9: log likelihood = -6848.6623 (backed up) Iteration 10: log likelihood = -6663.1645 Iteration 11: log likelihood = -5610.7581 Iteration 12: log likelihood = -5505.1785 Iteration 13: log likelihood = -5497.2516 Iteration 14: log likelihood = -5497.2263 Iteration 15: log likelihood = -5497.2263 Random-effects poisson Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Gamma Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(10) = 2018.46 Log likelihood = -5497.2263 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .5448782 .0427652 12.741 0.000 .4610599 .6286966 LOGR1 | .0536264 .0486086 1.103 0.270 -.0416446 .1488975 LOGR2 | .1708175 .0455619 3.749 0.000 .0815179 .2601171 LOGR3 | .0834562 .042003 1.987 0.047 .0011318 .1657807 LOGR4 | .0336115 .0381023 0.882 0.378 -.0410676 .1082907 LOGR5 | .1221372 .0312913 3.903 0.000 .0608074 .1834669 dyear2 | -.0240119 .0131981 -1.819 0.069 -.0498797 .0018558 dyear3 | -.0384157 .0134433 -2.858 0.004 -.0647642 -.0120673 dyear4 | -.1818836 .0138792 -13.105 0.000 -.2090863 -.154681 dyear5 | -.2569782 .0143074 -17.961 0.000 -.2850203 -.2289362 ---------+-------------------------------------------------------------------- /invln_a | -.7305102 .0771729 -9.466 0.000 -.8817664 -.579254 ---------+-------------------------------------------------------------------- alpha | 2.07614 .1602218 1.784707 2.415162 ------------------------------------------------------------------------------ Likelihood ratio test of alpha=0: chi2(1) = 45089.23 Prob > chi2 = 0.0000 . . * (4A) Negative binomial random effects with constant and time invariant regr > essors . xtnbreg PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LO > GK SCISECT, re i(id) Fitting comparison model: Iteration 0: log likelihood = -17836.658 Iteration 1: log likelihood = -17834.138 Iteration 2: log likelihood = -17834.138 Iteration 0: log likelihood = -7894.0709 Iteration 1: log likelihood = -6949.2078 Iteration 2: log likelihood = -6948.0025 Iteration 3: log likelihood = -6948.0022 Iteration 0: log likelihood = -6319.8641 Iteration 1: log likelihood = -5908.3056 Iteration 2: log likelihood = -5794.1132 Iteration 3: log likelihood = -5773.3657 Iteration 4: log likelihood = -5773.3537 Iteration 5: log likelihood = -5773.3537 Fitting full model: Iteration 0: log likelihood = -5081.8894 Iteration 1: log likelihood = -5055.9369 Iteration 2: log likelihood = -4968.235 Iteration 3: log likelihood = -4948.6352 Iteration 4: log likelihood = -4948.4944 Iteration 5: log likelihood = -4948.4944 Random-effects negative binomial Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Beta Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(12) = 944.21 Log likelihood = -4948.4944 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .3503119 .0652818 5.366 0.000 .2223619 .4782619 LOGR1 | -.0030317 .0750916 -0.040 0.968 -.1502085 .1441452 LOGR2 | .1049876 .0688488 1.525 0.127 -.0299537 .2399288 LOGR3 | .0163523 .0636376 0.257 0.797 -.1083752 .1410797 LOGR4 | .0359425 .0587161 0.612 0.540 -.0791389 .1510239 LOGR5 | .0718323 .0482887 1.488 0.137 -.0228119 .1664764 dyear2 | -.0436735 .0213435 -2.046 0.041 -.085506 -.0018411 dyear3 | -.0556597 .0218572 -2.547 0.011 -.098499 -.0128203 dyear4 | -.1831055 .0227183 -8.060 0.000 -.2276326 -.1385784 dyear5 | -.2300438 .0231525 -9.936 0.000 -.2754219 -.1846658 LOGK | .161937 .0417874 3.875 0.000 .0800351 .2438389 SCISECT | .117642 .1066164 1.103 0.270 -.0913224 .3266063 _cons | .8995618 .1681113 5.351 0.000 .5700697 1.229054 ---------+-------------------------------------------------------------------- /ln_r | .9877589 .0961426 10.274 0.000 .7993229 1.176195 /ln_s | .7009606 .1079684 6.492 0.000 .4893466 .9125747 ---------+-------------------------------------------------------------------- r | 2.68521 .2581631 2.224035 3.242015 s | 2.015688 .2176305 1.63125 2.490727 ------------------------------------------------------------------------------ Likelihood ratio test versus pooled: chi2(1) = 1649.72 Prob > chi2 = 0.0000 . . * (4B) Negative binomial random effects with constant . xtnbreg PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, r > e i(id) Fitting comparison model: Iteration 0: log likelihood = -19892.75 Iteration 1: log likelihood = -19892.686 Iteration 2: log likelihood = -19892.686 Iteration 0: log likelihood = -7894.0709 Iteration 1: log likelihood = -6949.2078 Iteration 2: log likelihood = -6948.0025 Iteration 3: log likelihood = -6948.0022 Iteration 0: log likelihood = -6330.7807 Iteration 1: log likelihood = -5952.2166 Iteration 2: log likelihood = -5810.8774 Iteration 3: log likelihood = -5785.1181 Iteration 4: log likelihood = -5785.0936 Iteration 5: log likelihood = -5785.0936 Fitting full model: Iteration 0: log likelihood = -5107.3198 Iteration 1: log likelihood = -5079.9162 Iteration 2: log likelihood = -4985.8007 Iteration 3: log likelihood = -4956.6183 Iteration 4: log likelihood = -4956.2586 Iteration 5: log likelihood = -4956.2585 Random-effects negative binomial Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Beta Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(10) = 907.90 Log likelihood = -4956.2585 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .387616 .064922 5.970 0.000 .2603713 .5148607 LOGR1 | .0183292 .0759714 0.241 0.809 -.130572 .1672304 LOGR2 | .1290892 .0697167 1.852 0.064 -.007553 .2657314 LOGR3 | .0246878 .0644597 0.383 0.702 -.1016508 .1510265 LOGR4 | .0577492 .0587279 0.983 0.325 -.0573553 .1728537 LOGR5 | .1000326 .0475006 2.106 0.035 .0069332 .193132 dyear2 | -.0467055 .0218036 -2.142 0.032 -.0894397 -.0039713 dyear3 | -.0651227 .0222266 -2.930 0.003 -.108686 -.0215594 dyear4 | -.2000645 .0228241 -8.765 0.000 -.2447989 -.15533 dyear5 | -.250956 .0229796 -10.921 0.000 -.2959951 -.2059169 _cons | 1.399438 .100604 13.910 0.000 1.202257 1.596618 ---------+-------------------------------------------------------------------- /ln_r | .9722767 .0952725 10.205 0.000 .785546 1.159007 /ln_s | .7040024 .1082646 6.503 0.000 .4918076 .9161972 ---------+-------------------------------------------------------------------- r | 2.643957 .2518964 2.193604 3.186768 s | 2.021829 .2188926 1.635269 2.499766 ------------------------------------------------------------------------------ Likelihood ratio test versus pooled: chi2(1) = 1657.67 Prob > chi2 = 0.0000 . . * (4C) Negative binomial random effects without constant & with time invarian > t regressors . xtnbreg PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5 LO > GK SCISECT, noconstant re i(id) Fitting comparison model: Iteration 0: log likelihood = -65127.755 Iteration 1: log likelihood = -26151.28 Iteration 2: log likelihood = -18567.168 Iteration 3: log likelihood = -18529.182 Iteration 4: log likelihood = -18529.165 Iteration 5: log likelihood = -18529.165 Iteration 0: log likelihood = -5904.4032 Iteration 1: log likelihood = -5839.3798 Iteration 2: log likelihood = -5817.3208 Iteration 3: log likelihood = -5817.3066 Iteration 4: log likelihood = -5817.3066 Fitting full model: Iteration 0: log likelihood = -5262.0667 (not concave) Iteration 1: log likelihood = -5012.985 Iteration 2: log likelihood = -4968.5877 Iteration 3: log likelihood = -4963.3239 Iteration 4: log likelihood = -4963.3046 Iteration 5: log likelihood = -4963.3046 Random-effects negative binomial Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Beta Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(12) = 2344.80 Log likelihood = -4963.3046 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .2968033 .0669427 4.434 0.000 .1655979 .4280086 LOGR1 | -.00517 .0782997 -0.066 0.947 -.1586347 .1482947 LOGR2 | .0856836 .0714817 1.199 0.231 -.0544179 .2257851 LOGR3 | .004177 .0659593 0.063 0.950 -.1251009 .1334548 LOGR4 | .0105178 .0608977 0.173 0.863 -.1088395 .1298751 LOGR5 | .0484592 .0503421 0.963 0.336 -.0502095 .1471278 dyear2 | -.0324976 .0215694 -1.507 0.132 -.074773 .0097777 dyear3 | -.0378536 .0218943 -1.729 0.084 -.0807655 .0050584 dyear4 | -.1599443 .0225855 -7.082 0.000 -.2042111 -.1156775 dyear5 | -.201171 .0227909 -8.827 0.000 -.2458403 -.1565017 LOGK | .3433991 .0271428 12.652 0.000 .2902003 .396598 SCISECT | .4279508 .0896063 4.776 0.000 .2523257 .6035758 ---------+-------------------------------------------------------------------- /ln_r | .8901058 .0927097 9.601 0.000 .7083981 1.071813 /ln_s | .767335 .1116862 6.870 0.000 .5484341 .9862358 ---------+-------------------------------------------------------------------- r | 2.435387 .225784 2.030736 2.920671 s | 2.154018 .240574 1.730541 2.681123 ------------------------------------------------------------------------------ Likelihood ratio test versus pooled: chi2(1) = 1708.00 Prob > chi2 = 0.0000 . . * (4D) Negative binomial random effects without constant . xtnbreg PAT LOGR LOGR1 LOGR2 LOGR3 LOGR4 LOGR5 dyear2 dyear3 dyear4 dyear5, n > oconstant re i(id) Fitting comparison model: Iteration 0: log likelihood = -66997.996 Iteration 1: log likelihood = -32401.779 Iteration 2: log likelihood = -28072.945 Iteration 3: log likelihood = -28041.857 Iteration 4: log likelihood = -28041.843 Iteration 5: log likelihood = -28041.843 Iteration 0: log likelihood = -6121.3411 Iteration 1: log likelihood = -6002.9016 Iteration 2: log likelihood = -5994.3784 Iteration 3: log likelihood = -5994.3376 Iteration 4: log likelihood = -5994.3376 Fitting full model: Iteration 0: log likelihood = -7138.2265 (not concave) Iteration 1: log likelihood = -5567.0904 (not concave) Iteration 2: log likelihood = -5210.7326 Iteration 3: log likelihood = -5173.4633 Iteration 4: log likelihood = -5101.6617 Iteration 5: log likelihood = -5074.8435 Iteration 6: log likelihood = -5074.6253 Iteration 7: log likelihood = -5074.6252 Random-effects negative binomial Number of obs = 1730 Group variable (i) : id Number of groups = 346 Random effects u_i ~ Beta Obs per group: min = 5 avg = 5.0 max = 5 Wald chi2(10) = 2556.24 Log likelihood = -5074.6252 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ PAT | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- LOGR | .3319567 .0801051 4.144 0.000 .1749535 .4889598 LOGR1 | .1538029 .0963454 1.596 0.110 -.0350306 .3426364 LOGR2 | .1730415 .0881136 1.964 0.050 .000342 .345741 LOGR3 | .0294948 .0807561 0.365 0.715 -.1287842 .1877738 LOGR4 | .0417389 .0730819 0.571 0.568 -.101499 .1849768 LOGR5 | .1711586 .0574192 2.981 0.003 .058619 .2836981 dyear2 | .018335 .0266101 0.689 0.491 -.03382 .0704899 dyear3 | -.0076266 .0272247 -0.280 0.779 -.060986 .0457329 dyear4 | -.1482565 .0280052 -5.294 0.000 -.2031458 -.0933672 dyear5 | -.2006615 .0281702 -7.123 0.000 -.255874 -.1454489 ---------+-------------------------------------------------------------------- /ln_r | .843112 .0920977 9.155 0.000 .6626038 1.02362 /ln_s | 1.547617 .1071447 14.444 0.000 1.337617 1.757616 ---------+-------------------------------------------------------------------- r | 2.323587 .2139971 1.939837 2.783253 s | 4.700254 .5036072 3.809953 5.798599 ------------------------------------------------------------------------------ Likelihood ratio test versus pooled: chi2(1) = 1839.42 Prob > chi2 = 0.0000 . . . ********** CLOSE OUTPUT . log close