. table mental pses [freq=count] ----------+----------------------------------- Mental | Health | Parents Socioeconomic status Status | A B C D E F ----------+----------------------------------- Well | 64 57 57 72 36 21 Mild | 94 94 105 141 97 71 Moderate | 58 54 65 77 54 54 Impaired | 46 40 60 94 78 71 ----------+----------------------------------- . *** Model [1] *** . loglin count mental pses, fit(pses, mental) keep Variable mental = A Variable pses = B Margins fit: pses, mental Note: Regression-like constraints are assumed. The first level of each variable (and all iteractions with it) will be dropped from estimation. Poisson regression Number of obs = 24 Goodness-of-fit chi2(15) = 47.418 Model chi2(8) = 169.982 Prob > chi2 = 0.0000 Prob > chi2 = 0.0000 Log Likelihood = -95.795 Pseudo R2 = 0.4701 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | .6734098 .0701317 9.602 0.000 .5359541 .8108654 A3 | .1647965 .0775871 2.124 0.034 .0127286 .3168645 A4 | .2367316 .0763415 3.101 0.002 .087105 .3863581 B2 | -.0670861 .0888731 -0.755 0.450 -.2412742 .1071019 B3 | .0911379 .0854466 1.067 0.286 -.0763343 .2586101 B4 | .3822983 .0801309 4.771 0.000 .2252446 .539352 B5 | .0113854 .0871228 0.131 0.896 -.1593721 .1821429 B6 | -.188447 .0917883 -2.053 0.040 -.3683487 -.0085452 _cons | 3.880619 .080447 48.238 0.000 3.722946 4.038292 ------------------------------------------------------------------------------ Mental | Health | Parents Socioeconomic status Status | A B C D E F ----------+----------------------------------------- Well | 64.0 57.0 57.0 72.0 36.0 21.0 <--- observed count | 48.5 45.3 53.1 71.0 49.0 40.1 fitted value | 2.2 1.7 0.5 0.1 -1.9 -3.0 Pearson residual | Mild | 94.0 94.0 105.0 141.0 97.0 71.0 | 95.0 88.8 104.1 139.3 96.1 78.7 | -0.1 0.5 0.1 0.1 0.1 -0.9 | Moderate | 58.0 54.0 65.0 77.0 54.0 54.0 | 57.1 53.4 62.6 83.7 57.8 47.3 | 0.1 0.1 0.3 -0.7 -0.5 1.0 | Impaired | 46.0 40.0 60.0 94.0 78.0 71.0 | 61.4 57.4 67.3 90.0 62.1 50.9 | -2.0 -2.3 -0.9 0.4 2.0 2.8 ----------+----------------------------------------- . *** Model [2] *** . gen as2 = A2 * pses . gen as3 = A3 * pses . gen as4 = A4 * pses . poisson count A2-A4 B2-B6 as2-as4, nolog Poisson regression Number of obs = 24 Goodness-of-fit chi2(12) = 6.281 Model chi2(11) = 211.119 Prob > chi2 = 0.9012 Prob > chi2 = 0.0000 Log Likelihood = -75.227 Pseudo R2 = 0.5839 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | .2009946 .157946 1.273 0.203 -.1085739 .5105631 A3 | -.3711867 .1775683 -2.090 0.037 -.7192141 -.0231592 A4 | -.8256483 .1849172 -4.465 0.000 -1.188079 -.4632172 B2 | -.2081025 .0932483 -2.232 0.026 -.3908659 -.0253392 B3 | -.2005567 .1038801 -1.931 0.054 -.4041581 .0030446 B4 | -.0697721 .1222054 -0.571 0.568 -.3092903 .1697461 B5 | -.6107386 .1544521 -3.954 0.000 -.9134592 -.308018 B6 | -.9902264 .1884988 -5.253 0.000 -1.359677 -.6207755 as2 | .1450885 .0442274 3.281 0.001 .0584044 .2317726 as3 | .1634321 .0488806 3.343 0.001 .0676279 .2592362 as4 | .3068185 .0489377 6.270 0.000 .2109024 .4027346 _cons | 4.227795 .1006668 41.998 0.000 4.030491 4.425098 ------------------------------------------------------------------------------ Mental | Health | Parents Socioeconomic status Status | A B C D E F ----------+----------------------------------------- Well | 64.0 57.0 57.0 72.0 36.0 21.0 <--- observed count | 68.6 55.7 56.1 63.9 37.2 25.5 fitted value | -0.6 0.2 0.1 1.0 -0.2 -0.9 Pearson residual | Mild | 94.0 94.0 105.0 141.0 97.0 71.0 | 96.9 91.0 106.0 139.7 94.0 74.4 | -0.3 0.3 -0.1 0.1 0.3 -0.4 | Moderate | 58.0 54.0 65.0 77.0 54.0 54.0 | 55.7 53.3 63.2 84.8 58.2 46.9 | 0.3 0.1 0.2 -0.8 -0.5 1.0 | Impaired | 46.0 40.0 60.0 94.0 78.0 71.0 | 40.8 45.0 61.7 95.5 75.6 70.3 | 0.8 -0.8 -0.2 -0.2 0.3 0.1 ----------+----------------------------------------- . *** Model [3] *** . gen bm2 = B2 * mental . gen bm3 = B3 * mental . gen bm4 = B4 * mental . gen bm5 = B5 * mental . gen bm6 = B6 * mental . poisson count A2-A4 B2-B6 bm2-bm6, nolog Poisson regression Number of obs = 24 Goodness-of-fit chi2(10) = 6.830 Model chi2(13) = 210.570 Prob > chi2 = 0.7414 Prob > chi2 = 0.0000 Log Likelihood = -75.501 Pseudo R2 = 0.5824 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | .5334226 .0877978 6.076 0.000 .3613421 .705503 A3 | -.1368039 .1333897 -1.026 0.305 -.3982429 .124635 A4 | -.2500072 .1840027 -1.359 0.174 -.6106459 .1106315 B2 | -.0357776 .2213992 -0.162 0.872 -.469712 .3981568 B3 | -.1754722 .2163208 -0.811 0.417 -.5994533 .2485088 B4 | -.0147854 .2039161 -0.073 0.942 -.4144537 .3848828 B5 | -.7523687 .2289032 -3.287 0.001 -1.201011 -.3037266 B6 | -1.332854 .2513361 -5.303 0.000 -1.825463 -.8402439 bm2 | -.0134877 .087366 -0.154 0.877 -.1847219 .1577464 bm3 | .1117006 .0833497 1.340 0.180 -.0516618 .2750629 bm4 | .164433 .0781659 2.104 0.035 .0112307 .3176353 bm5 | .3065792 .0848995 3.611 0.000 .1401792 .4729792 bm6 | .4459213 .0900769 4.950 0.000 .269374 .6224687 _cons | 4.096861 .1068535 38.341 0.000 3.887432 4.30629 ------------------------------------------------------------------------------ Mental | Health | Parents Socioeconomic status Status | A B C D E F ----------+----------------------------------------- Well | 64.0 57.0 57.0 72.0 36.0 21.0 <--- observed count | 60.2 57.3 56.4 69.9 38.5 24.8 fitted value | 0.5 -0.0 0.1 0.3 -0.4 -0.8 Pearson residual | Mild | 94.0 94.0 105.0 141.0 97.0 71.0 | 102.5 96.3 107.6 140.4 89.2 66.0 | -0.8 -0.2 -0.2 0.1 0.8 0.6 | Moderate | 58.0 54.0 65.0 77.0 54.0 54.0 | 52.5 48.6 61.5 84.7 62.0 52.7 | 0.8 0.8 0.4 -0.8 -1.0 0.2 | Impaired | 46.0 40.0 60.0 94.0 78.0 71.0 | 46.8 42.8 61.4 89.1 75.2 73.5 | -0.1 -0.4 -0.2 0.5 0.3 -0.3 ----------+----------------------------------------- . *** Model [4] *** . gen ms = mental * pses . poisson count A2-A4 B2-B6 ms, nolog Poisson regression Number of obs = 24 Goodness-of-fit chi2(14) = 9.896 Model chi2(9) = 207.505 Prob > chi2 = 0.7698 Prob > chi2 = 0.0000 Log Likelihood = -77.034 Pseudo R2 = 0.5739 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | .3789152 .083597 4.533 0.000 .2150681 .5427623 A3 | -.4452975 .1248902 -3.566 0.000 -.6900779 -.2005171 A4 | -.7099058 .1746036 -4.066 0.000 -1.052123 -.3676892 B2 | -.2766081 .0944528 -2.929 0.003 -.4617321 -.0914841 B3 | -.3365119 .1084114 -3.104 0.002 -.5489943 -.1240294 B4 | -.2722776 .1315495 -2.070 0.038 -.5301098 -.0144454 B5 | -.879021 .1690328 -5.200 0.000 -1.210319 -.5477229 B6 | -1.3236 .2094638 -6.319 0.000 -1.734141 -.9130582 ms | .0906866 .0150061 6.043 0.000 .0612751 .1200981 _cons | 4.088165 .0829941 49.258 0.000 3.9255 4.250831 ------------------------------------------------------------------------------ Mental | Health | Parents Socioeconomic status Status | A B C D E F ----------+----------------------------------------- Well | 64.0 57.0 57.0 72.0 36.0 21.0 <--- observed count | 65.3 54.2 55.9 65.3 39.0 27.3 fitted value | -0.2 0.4 0.1 0.8 -0.5 -1.2 Pearson residual | Mild | 94.0 94.0 105.0 141.0 97.0 71.0 | 104.4 94.9 107.2 137.0 89.6 68.8 | -1.0 -0.1 -0.2 0.3 0.8 0.3 | Moderate | 58.0 54.0 65.0 77.0 54.0 54.0 | 50.1 49.9 61.7 86.4 61.8 52.0 | 1.1 0.6 0.4 -1.0 -1.0 0.3 | Impaired | 46.0 40.0 60.0 94.0 78.0 71.0 | 42.1 45.9 62.2 95.3 74.7 68.8 | 0.6 -0.9 -0.3 -0.1 0.4 0.3 ----------+----------------------------------------- . *** Model [5] *** . drop A2-bm6 . loglin count mental pses, fit(mental pses) keep nolog Variable mental = A Variable pses = B Margins fit: mental pses Note: Regression-like constraints are assumed. The first level of each variable (and all iteractions with it) will be dropped from estimation. Poisson regression Number of obs = 24 Goodness-of-fit chi2(0) = 0.001 Model chi2(23) = 217.399 Prob > chi2 = . Prob > chi2 = 0.0000 Log Likelihood = -72.087 Pseudo R2 = 0.6013 ------------------------------------------------------------------------------ Table of coefficients omitted ------------------------------------------------------------------------------