This is the smoking data from Agresti, page 280, Table 8.10 . table smoke breathe [freq=count], by(age) ----------+----------------- age and | breathe smoke | 0 1 2 ----------+----------------- 0 | 0 | 577 27 7 1 | 192 20 3 2 | 682 46 11 ----------+----------------- 1 | 0 | 164 4 1 | 145 15 7 2 | 245 47 27 ----------+----------------- . loglin count age smoke breathe, fit(age smoke, age breathe, smoke breathe) keep Variable age = A Variable smoke = B Variable breathe = C Margins fit: age smoke, age breathe, smoke breathe Poisson regression Number of obs = 18 Goodness-of-fit chi2(4) = 25.930 Model chi2(13) =4071.270 Prob > chi2 = 0.0000 Prob > chi2 = 0.0000 Log Likelihood = -59.922 Pseudo R2 = 0.9714 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -1.331803 .0879619 -15.141 0.000 -1.504205 -1.159401 AB22 | .994609 .136071 7.309 0.000 .7279148 1.261303 AB23 | .3836806 .1112767 3.448 0.001 .1655823 .601779 AC22 | .5380213 .1713439 3.140 0.002 .2021935 .8738492 AC23 | 1.378551 .2855132 4.828 0.000 .8189555 1.938147 B2 | -1.092331 .0809521 -13.494 0.000 -1.250994 -.9336679 B3 | .1307547 .0560022 2.335 0.020 .0209924 .2405169 BC22 | .788131 .2588234 3.045 0.002 .2808464 1.295416 BC23 | .8221374 .5030957 1.634 0.102 -.1639121 1.808187 BC32 | .8319164 .2139501 3.888 0.000 .412582 1.251251 BC33 | 1.346372 .4163868 3.233 0.001 .530269 2.162475 C2 | -3.312764 .1908858 -17.355 0.000 -3.686893 -2.938635 C3 | -5.144603 .4072795 -12.632 0.000 -5.942856 -4.34635 _cons | 6.373719 .0410737 155.178 0.000 6.293216 6.454222 ------------------------------------------------------------------------------ . gen sm = smoke*breathe . gen ag = age*breathe . gen smxag = age*smoke*breathe . poisson count A2 B2-B3 C2-C3 AB22-AB23 sm ag smxag Iteration 0: Log Likelihood = -53.05957 Iteration 1: Log Likelihood = -52.373047 Iteration 2: Log Likelihood = -52.365234 Poisson regression Number of obs = 18 Goodness-of-fit chi2(7) = 10.816 Model chi2(10) =4086.383 Prob > chi2 = 0.1468 Prob > chi2 = 0.0000 Log Likelihood = -52.365 Pseudo R2 = 0.9750 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -1.270009 .0884912 -14.352 0.000 -1.443448 -1.096569 B2 | -1.053549 .0795368 -13.246 0.000 -1.209438 -.8976593 B3 | .1706528 .0565407 3.018 0.003 .0598352 .2814705 C2 | -2.870714 .138546 -20.720 0.000 -3.142259 -2.599169 C3 | -4.518168 .2863695 -15.777 0.000 -5.079442 -3.956894 AB22 | .9853142 .1352932 7.283 0.000 .7201444 1.250484 AB23 | .2444348 .1156673 2.113 0.035 .017731 .4711385 sm | .11524 .0860175 1.340 0.180 -.0533512 .2838311 ag | -.3517998 .2844626 -1.237 0.216 -.9093363 .2057368 smxag | .6631256 .1646868 4.027 0.000 .3403454 .9859058 _cons | 6.349714 .0415878 152.682 0.000 6.268204 6.431225 ------------------------------------------------------------------------------ . poisson count A2-BC33 smxag Poisson regression Number of obs = 18 Goodness-of-fit chi2(3) = 2.744 Model chi2(14) =4094.455 Prob > chi2 = 0.4328 Prob > chi2 = 0.0000 Log Likelihood = -48.329 Pseudo R2 = 0.9769 ------------------------------------------------------------------------------ count | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------+-------------------------------------------------------------------- A2 | -1.261347 .0879694 -14.338 0.000 -1.433764 -1.08893 B2 | -1.102336 .0821034 -13.426 0.000 -1.263256 -.9414168 B3 | .1661617 .0565153 2.940 0.003 .0553938 .2769296 C2 | -3.059266 .1889129 -16.194 0.000 -3.429528 -2.689003 C3 | -4.490543 .3839238 -11.696 0.000 -5.24302 -3.738066 AB22 | .9834759 .1360522 7.229 0.000 .7168184 1.250133 AB23 | .2386368 .1153571 2.069 0.039 .012541 .4647325 AC22 | -.6755238 .3476753 -1.943 0.052 -1.356955 .0059072 AC23 | -1.252238 .715659 -1.750 0.080 -2.654904 .1504279 BC22 | .7244893 .2624945 2.760 0.006 .2100095 1.238969 BC23 | .7754917 .5245877 1.478 0.139 -.2526814 1.803665 BC32 | .3918116 .2359121 1.661 0.097 -.0705677 .8541909 BC33 | .2536903 .4856715 0.522 0.601 -.6982083 1.205589 smxag | .8311127 .1945991 4.271 0.000 .4497055 1.21252 _cons | 6.358587 .0415525 153.025 0.000 6.277146 6.440029 ------------------------------------------------------------------------------ . display chiprob( 7-3 , 10.816-2.744) .08897606