options double crt memory=6 nwidth=23,signif=15; name count; title 'Count data benchmarks'; title 'Poisson, NegBin 2, NegBin 1, Ordered Probit'; ? ? Data from Cameron's web page http://www.econ.ucdavis.edu/~cameron , ? in Chapter 3. ? smpl 1,5190; read(file='racd3.asc',FORMAT='(F3.0,F5.2,F7.4,F5.2,12F4.0,3F3.0)') SEX,AGE,AGESQ,INCOME,LEVYPLUS,FREEPOOR,FREEREPA, ILLNESS,ACTDAYS,HSCORE,CHCOND1,CHCOND2, DVISITS,NONDOCCO,HOSPADMI,HOSPDAYS, MEDICINE,PRESCRIB,NONPRESC; LIST X C,SEX,AGE,AGESQ,INCOME,LEVYPLUS,FREEPOOR,FREEREPA, ILLNESS,ACTDAYS,HSCORE,CHCOND1,CHCOND2 ; LIST Y DVISITS ; ? TSP 4.5 commands POISSON, NEGBIN, and ORDPROB are used here. ? The same results can be obtained with the ML command in TSP 4.2 ? or later, by coding the log likelihood as shown in the TSP User's ? Guide, Chapter 9. POISSON(TOL=1.e-11,hcov=nbw) Y X; title 'reproduce diagnostics for Poisson'; copy @logl loglu; copy @lr lru; copy %lr %lru; title 'sum of squared residuals'; mat ssr = @res'@res; print ssr @ssr; title 'correlation type R-Squared'; corr(noprint) y @fit; set rsq = @corr(2,1)**2; print rsq @rsq; title 'Schwartz Bayesian Information Criterion'; set sbic = -@logl + @ncoef*log(@nob)/2; print sbic @sbic; title 'overdispersion test for Poisson vs. NegBin 2'; v = (@res**2 - dvisits)/@fit; olsq(silent) v c @fit; ?olsq(silent) v @fit; ? yields same results set tr2 = @nob*@rsq; cdf(chisq,df=1,print) tr2 %tr2; print tr2 @overdis %tr2 %overdis; title 'Likelihood Ratio test (zero slopes)'; poisson(silent) y c; copy @logl loglc; set lr = 2*(loglu - loglc); cdf(df=12) lr %lr; print lr lru %lr %lru; NEGBIN(TOL=1.e-11,hcov=nbw) Y X; NEGBIN(model=1,TOL=1.e-11,hcov=nbw) Y X; ORDPROB(TOL=1.e-11) Y X; ? -------------------------- ? BENCHMARKS ? -------------------------- ? Poisson ? ------- ? TSP 4.5 "fails to improve" with tol=1e-11, but the gradient norm ? is very small; the change vector indicates the ? coefficients are accurate to about 9 digits. ? CT '98 is Cameron and Trivedi, "Regression Analysis of Count Data", ? 1998. Their Table 3.3 on p.69 gives 2-5 digits. Cameron's web ? page has a Limdep 7.0 (dated 3/28/97) output file (racd3p1.out) ? with more digits, which is given in the column here. Apparently ? default convergence criteria are used, so it is likely not ? attempting to yield 9 accurate digits. The CT '98 results appear ? to be accurate to 6-7 digits (the only number that does not agree ? precisely with TSP 4.5 is the 7th digit of AGESQ). ? ? CT '98 TSP 4.5 ? C -2.223848 -2.223848181436219 ? (SE Hess) (.18982) (.1898161103147973) ? (SE OP) (.1443) (.1443306580106138) ? (SE White) (.2544) (.2544321777810399) ? SEX .1568820 .1568819568043021 ? (.056137) (.0561368232992708) ? (.04062) (.0406153307634731) ? (.07921) (.0792133147467761) ? AGE 1.056299 1.056299034354181 ? (1.0008) (1.000780488775131) ? ( .7499) ( .7498654594905748) ? (1.364) (1.364342673822911) ? AGESQ -.8487041 -.8487036032196287 ? (1.0778) (1.077784496808641) ? ( .8092) ( .8092146509262367) ? (1.459) (1.459542551560653) ? INCOME -.2053206 -.2053205773349278 ? (.088379) (.0883793190999392) ? (.06192) (.0619209536696690) ? (.1292) (.1292446949776360) ? LEVYPLUS .1231854 .1231854352469205 ? (.071640) (.0716398380867105) ? (.05605) (.0560472029154789) ? (.09516) (.0951559887850300) ? FREEPOOR -.4400609 -.4400609103688046 ? (.17981) (.1798114868958799) ? (.1164) (.1163511428984060) ? (.2900) (.2899945088595965) ? FREEREPA .07979843 .0797984290651871 ? (.092060) (.0920602762134002) ? (.07006) (.0700593802415053) ? (.1258) (.1257831694126219) ? ILLNESS .1869484 .1869484298982952 ? (.018281) (.0182805458800062) ? (.01419) (.0141893354363903) ? (.02394) (.0239363741957972) ? ACTDAYS .1268465 .1268464793410004 ? (.0050340) (.005033970913940530) ? (.003507) (.003507331432709834) ? (.007769) (.007769069027947318) ? HSCORE .03008100 .0300810048424617 ? (.010099) (.0100993734829807) ? (.007354) (.007354410997167587) ? (.01423) (.0142345312710553) ? CHCOND1 .1140853 .1140853080161600 ? (.066640) (.0666395513980557) ? (.05148) (.0514849442209186) ? (.09085) (.0908453386730918) ? CHCOND2 .1411583 .1411582794566710 ? (.083145) (.0831451169021863) ? (.05863) (.0586310140530031) ? (.1227) (.1227108100547251) ? LogL -3355.541 -3355.541344988208 ? iterations 8 8 ? Negative Binomial 2 ? -------------------- ? TSP 4.5 converges with tol=1e-11; coefficients should be accurate ? to 11 digits. ? Same source for CT '98 results. It appears that Limdep 7.0 ? uses BHHH ("OP") iterations, so it takes more iterations. ? Cameron and Trivedi note that the OP and Hessian standard errors ? generally agree to within 5%. In general, the CT '98 results ? agree with TSP 4.5 to 4-6 digits. ? ? CT '98 TSP 4.5 ? C -2.189992 -2.190006600908310 ? (SE Hess) (.2335801062423089) ? (SE OP) (.22246) (.2224622015003534) ? SEX .2166417 .2166435310287075 ? (.0693873223198172) ? (.065602) (.0656017312297610) ? AGE -.2162187 -.2161585910668744 ? (1.281015620169951) ? (1.2342) (1.234179949457092) ? AGESQ .6092261 .6091585085721778 ? (1.406184552984574) ? (1.3805) (1.380478547229379) ? INCOME -.1422026 -.1422016043604077 ? (.1081901547578400) ? (.097665) (.0976647496066319) ? LEVYPLUS .1180613 .1180640534193854 ? (.0855379124143664) ? (.084878) (.0848782449868209) ? FREEPOOR -.4966097 -.4966109759002484 ? (.2068902481735172) ? (.17510) (.1750975566944345) ? FREEREPA .1449816 .1449815845204400 ? (.1169488617257534) ? (.11743) (.1174290319462188) ? ILLNESS .2143390 .2143413518674721 ? (.0242276051922667) ? (.025735) (.0257348319774228) ? ACTDAYS .1437545 .1437537027266851 ? (.007813997766260954) ? (.0074716) (.007471634376669513) ? HSCORE .03806005 .0380601368011592 ? (.0137991867455183) ? (.014257) (.0142574162955127) ? CHCOND1 .09935864 .0993549801424050 ? (.0787023180606291) ? (.076651) (.0766507199670255) ? CHCOND2 .1903259 .1903270208007537 ? (.1044086623341952) ? (.094825) (.0948246239850710) ? ALPHA 1.077035 1.077037790002048 ? (.1030124101822934) ? (.098463) (.0984636193736862) ? LogL -3198.744 -3198.743836308880 ? iterations 17 9 ? Negative Binomial 1 ? -------------------- ? TSP 4.5 "fails to improve" with tol=1e-11, but the gradient norm ? is extremely small; the change vector indicates the ? coefficients are accurate to about 11 digits, except ? for AGE and AGESQ, which are good to about 10 digits. ? CT '98 is Cameron and Trivedi, "Regression Analysis of Count Data", ? 1998. Their Table 3.4 on p.76 gives 2-5 digits. ? The log likelihood is given to more digits in CT '86: ? Cameron and Trivedi, "Econometric Models of Count Data", ? Journal of Applied Econometrics, January 1986, p.47. The '86 ? coefficients and SEs are not as accurate as the '98 coefficients, ? so the '98 coefficients and SEs are used with the '86 log likelihood. ? There are apparenly 2 typographical errors, since most coefficients ? and standard errors match to 3 digits: ? 1. The LogL in CT '86 was probably -3226.859 (printed: -3226.589). ? Apparently it was then rounded to -3226.6 in CT '98. ? 2. The OP SE for AGESQ should be 1.199 (vs. 1.119). ? The Limdep output file on Cameron's web page does not include ? output for Negative Binomial 1. ? In general, the CT '98 results agree with TSP 4.5 to 2-4 digits. ? ? CT '98 TSP 4.5 ? C -2.202 -2.201653243182391 ? (SE Hess) (.2203799889730245) ? (SE OP) (.214) (.2141829822024417) ? SEX .164 .1638500774613639 ? (.0652316478742917) ? (.060) (.0602329122675504) ? AGE .279 .2789485009014563 ? (1.160848408736853) ? (1.126) (1.125693967682811) ? AGESQ .021 .0205554327504611 ? (1.250842524074213) ? (1.119)? (1.198989471198492) ? INCOME -.135 -.1345762406177768 ? (.1022989320391736) ? (.096) (.0957423426452074) ? LEVYPLUS .212 .2124023858784924 ? (.0834910298641412) ? (.084) (.0842034633932930) ? FREEPOOR -.538 -.5375815769011500 ? (.2283607259868848) ? (.209) (.2093452711948197) ? FREEREPA .208 .2081484301226569 ? (.1072238523328557) ? (.104) (.1037797069403984) ? ILLNESS .196 .1958315540235922 ? (.0210602174196905) ? (.021) (.0206005404874690) ? ACTDAYS .112 .1123214828842008 ? (.006232825220207222) ? (.006) (.005552473404881100) ? HSCORE .036 .0357503273211181 ? (.0117979822983468) ? (.010) (.0104725206545704) ? CHCOND1 .132 .1325500507237239 ? (.0765783964917135) ? (.075) (.0745879831851399) ? CHCOND2 .174 .1741326531013919 ? (.0969892177496803) ? (.089) (.0890236466305760) ? ALPHA .455 .4552411787249454 ? (.0471979111729704) ? (.041) (.0405266828097222) ? LogL -3226.589? -3226.858981517131 ? Ordered Probit ? -------------- ? CT '86 is Cameron and Trivedi, "Econometric Models of Count Data", ? Journal of Applied Econometrics, January 1986, p.47. I believe ? the standard errors given there are Hessian, but this is not ? explicit. The Ordered Probit results in CT '98 are not used here ? because those have recoded the single Y=9 observation and are ? not present in the Limdep output file. In general, the CT '86 ? results agree with TSP 4.5 to 0-3 digits -- not bad for 12 year ? old results computed on a mainframe, and not surprising given ? the difference in Log Likelihood. I suspect the HSCORE coefficient ? might be a typographical error, intended as .0321 . ? ? CT '86 TSP 4.5 ? C -1.390 -1.379019134006415 ? (SE Hess) (.1480) (.1474098386482508) ? SEX .1301 .1313089684845851 ? (.0436) (.0437820679413322) ? AGE -.5784 -.5340408071386152 ? (.8226) (.8158708824003552) ? AGESQ .9159 .8568635837985064 ? (.9009) (.8983175630133506) ? INCOME -.0537 -.0624269900955009 ? (.0663) (.0680086332181469) ? LEVYPLUS .1418 .1373124395446530 ? (.0558) (.0532635341233098) ? FREEPOOR -.3347 -.3461441320208328 ? (.1257) (.1296435791090846) ? FREEREPA .1874 .1790881220565310 ? (.0757) (.0743426402106722) ? ILLNESS .1523 .1506184814648107 ? (.0163) (.0157460598331635) ? ACTDAYS .0998 .1005628833982894 ? (.0055) (.005848915907984538) ? HSCORE .0821? .0320737014256989 ? (.0091) (.009200146638411271) ? CHCOND1 .0624 .0614125523105562 ? (.0499) (.0490243661389076) ? CHCOND2 .1402 .1358075896231861 ? (.0657) (.0676997457382795) ? MU2 .9417 .9389578897623265 ? (.0313) (.0312213937785624) ? MU3 1.512 1.514332241170535 ? (.0518) (.0493279663886323) ? MU4 1.700 1.711645349418508 ? (.0627) (.0581417321908117) ? MU5 1.9420 1.952704088437297 ? (.0806) (.0719908003079560) ? MU6 2.079 2.087141312001792 ? (.0942) (.0816115229816700) ? MU7 2.330 2.333146578102004 ? (.1029) (.1016778380001500) ? MU8 ? 2.787514426721434 ? ? (.1558622655482340) ? MU9 3.299 3.474203627669630 ? (.4376) (.3513862912982778) ? LogL -3140.6 -3140.280559122243 ? iterations 20 6