Why Model Table Cells as Counts?
A contingency table records how many observations fall into each combination of categories. For example, a table might classify patients by treatment group and outcome, or calls by day and type. The entries are counts, but the table alone does not say how those counts were generated. A sampling model makes that assumption explicit and provides a probability model for the cell counts.
One useful model treats the count in each cell as a Poisson response, with different cells allowed to have different expected counts. Assuming the cell counts are independent gives a particularly direct likelihood for the table. A log link then models each positive cell mean as a function of the cell’s categorical characteristics. This is the basic setup for loglinear modeling: the modeled quantities are expected cell counts, not individual binary outcomes.
The Independent Poisson Cell Model
The Poisson assumption gives \(E[Y_c]=\operatorname{Var}(Y_c)=\mu_c\). Independence is an additional assumption: it says that knowing the count in one cell does not change the probability distribution assigned to another cell. It is not a consequence of arranging counts in a table.
The loglinear predictor is attached to a cell, rather than to a single observation. A cell’s predictors might encode its row and column categories, an indicator for a particular combination, or other known cell-level information. The log link is useful because additive changes in the predictor correspond to multiplicative changes in the expected count. The detailed parameterization of particular table structures is a separate question; here the essential point is that the response is the cell count and its mean is modeled on the log scale.
Worked Example: A Table With Independent Poisson Counts
Suppose a clinic records the number of patients in each combination of treatment and outcome. For illustration, assume the four cell counts are independent Poisson random variables with means \(12, 8, 9,\) and \(6\):
| Improved | Not improved | |
|---|---|---|
| Treatment A | \(Y_{11}\), mean \(12\) | \(Y_{12}\), mean \(8\) |
| Treatment B | \(Y_{21}\), mean \(9\) | \(Y_{22}\), mean \(6\) |
For instance, \(Y_{11}\sim\operatorname{Poisson}(12)\), so its probability of equaling 10 is $$ P(Y_{11}=10)=e^{-12}\frac{12^{10}}{10!}. $$ The probability of observing exactly \(10,7,8,5\) in the four cells is the product of the four cell probabilities: $$ P(10,7,8,5) = \left(e^{-12}\frac{12^{10}}{10!}\right) \left(e^{-8}\frac{8^7}{7!}\right) \left(e^{-9}\frac{9^8}{8!}\right) \left(e^{-6}\frac{6^5}{5!}\right). $$ The product is justified by the assumed independence. This model does not require the observed grand total to be fixed in advance; that total is itself random.
Likelihood and the Random Grand Total
For observed counts \(y_1,\ldots,y_K\), the joint probability under independent Poisson sampling is $$ P(Y_1=y_1,\ldots,Y_K=y_K) = \prod_{c=1}^K e^{-\mu_c}\frac{\mu_c^{y_c}}{y_c!}. $$ Writing \(\ell\) for the log-likelihood, this gives $$ \ell = \sum_{c=1}^K \left(y_c\log(\mu_c)-\mu_c-\log(y_c!)\right). $$ When the means have the loglinear form \(\log(\mu_c)=\boldsymbol{x}_c^{\mathsf T}\boldsymbol{\beta}\), the cell-specific means are linked through the shared parameter vector. The factorial terms depend on the observed counts but not on the parameters. This likelihood is why the Poisson cell model provides a convenient foundation for modeling a whole contingency table.
Proof. For a nonnegative integer \(n\), sum the joint probabilities over all nonnegative integer cell counts whose sum is \(n\): $$ P(N=n) = e^{-M} \sum_{\substack{y_1+\cdots+y_K=n\\ y_c\geq 0}} \prod_{c=1}^K\frac{\mu_c^{y_c}}{y_c!}. $$ The multinomial theorem, applied to \((\mu_1+\cdots+\mu_K)^n\), states that $$ (\mu_1+\cdots+\mu_K)^n = \sum_{\substack{y_1+\cdots+y_K=n\\ y_c\geq 0}} \frac{n!}{y_1!\cdots y_K!} \prod_{c=1}^K\mu_c^{y_c}. $$ Dividing by \(n!\) and using \(M=\sum_c\mu_c\) therefore yields $$ P(N=n)=e^{-M}\frac{M^n}{n!}, $$ the probability mass function of a Poisson random variable with mean \(M\). Thus \(N\sim\operatorname{Poisson}(M)\). \(\square\)
This result clarifies an important feature of the sampling scheme: independent Poisson cell counts imply a random grand total. Its expected value is \(M\), and its distribution is Poisson with that mean. The table total is not being conditioned to equal a prespecified sample size.
Worked Example: A Log Mean for Each Cell
Suppose each cell is described by two binary indicators, \(a\) and \(b\), each taking values 0 or 1. Consider the specified loglinear mean $$ \log(\mu_{ab})=\log(10)+a\log(2)+b\log(3). $$ Find all four cell means.
For \(a=0,b=0\), the predictor is \(\log(10)\), so \(\mu_{00}=10\).
For \(a=1,b=0\), the predictor is \(\log(10)+\log(2)=\log(20)\), so \(\mu_{10}=20\).
For \(a=0,b=1\), it is \(\log(10)+\log(3)=\log(30)\), so \(\mu_{01}=30\).
For \(a=1,b=1\), it is \(\log(10)+\log(2)+\log(3)=\log(60)\), so \(\mu_{11}=60\). If the four cell counts are independent Poisson responses with these means, the grand total has a Poisson distribution with mean \(10+20+30+60=120\), by the result just proved.
The example illustrates how an additive expression for log means becomes a multiplicative expression for means. It does not require the observed counts to equal their means; the means specify the distributions that generate the counts.
Conditioning on the Total Gives a Multinomial Model
An alternative sampling description fixes the total number of observations and allocates them among cells. The connection between that description and independent Poisson sampling follows by conditioning on the Poisson grand total. It is useful to derive this connection carefully, because it explains why the two sampling models can describe related table probabilities while making different assumptions about the total.
Proof. The event \(N=n\) has probability \(e^{-M}M^n/n!\), which is positive for \(M>0\). By the definition of conditional probability and independence, $$ \begin{aligned} P(Y_1=y_1,\ldots,Y_K=y_K\mid N=n) &= \frac{\prod_{c=1}^K e^{-\mu_c}\mu_c^{y_c}/y_c!} {e^{-M}M^n/n!}\\ &= \frac{n!}{\prod_{c=1}^K y_c!} \frac{\prod_{c=1}^K\mu_c^{y_c}}{M^n}. \end{aligned} $$ Since \(\sum_c y_c=n\), we have $$ \frac{\prod_{c=1}^K\mu_c^{y_c}}{M^n} = \prod_{c=1}^K\left(\frac{\mu_c}{M}\right)^{y_c} = \prod_{c=1}^Kp_c^{y_c}. $$ Also \(\sum_cp_c=1\). Substitution gives the stated multinomial probability mass function. \(\square\)
Worked Example: Conditioning Three Poisson Counts on Their Total
Let \(Y_1,Y_2,Y_3\) be independent Poisson counts with means \(4,6,2\), respectively. Their sum has mean \(M=12\). Conditional on a total of \(n=6\), the cell probabilities are $$ p_1=\frac{4}{12}=\frac13,\qquad p_2=\frac{6}{12}=\frac12,\qquad p_3=\frac{2}{12}=\frac16. $$ Find the conditional probability of the cell-count vector \((2,3,1)\).
The counts sum to six, so the conditional formula applies: $$ \begin{aligned} P(Y_1=2,Y_2=3,Y_3=1\mid N=6) &= \frac{6!}{2!3!1!} \left(\frac13\right)^2 \left(\frac12\right)^3 \left(\frac16\right)\\ &= 60\cdot\frac{1}{9}\cdot\frac{1}{8}\cdot\frac{1}{6}\\ &=\frac{60}{432}=\frac{5}{36}. \end{aligned} $$ The total is fixed at six only in this conditional calculation. Before conditioning, the total is Poisson with mean 12 and can take different nonnegative values.
When the Sampling Assumption Matters
The independent Poisson model is appropriate when the data collection process allows the number of observations to vary and cell counts can reasonably be treated as independent. For example, events may be counted over separate locations or time periods, with each cell’s expected count determined by its characteristics. Whether independence is credible depends on how the observations were generated, not on the mathematical convenience of the model.
If investigators recruit exactly \(n\) people and classify every one into a table cell, the total is fixed by design. A multinomial sampling model directly describes that setup. The conditional result shows how it relates to independent Poisson counts, but it does not make the two original designs identical: under independent Poisson sampling the grand total varies, whereas under fixed-total sampling it does not. Conditioning removes the part of the Poisson model that describes the total and leaves the relative cell probabilities.
A loglinear model is useful because it gives a systematic way to relate expected counts to cell characteristics while respecting their positivity. The independent Poisson likelihood also applies directly to tables with a random total. In settings with a fixed total, conditioning provides a corresponding allocation model. Choosing between these interpretations begins with the sampling design.
Common Mistakes
- Assuming a table automatically has independent cells. A grid of counts is only a format. Independence is a modeling assumption that must be justified by the data-collection process.
- Treating the Poisson grand total as fixed. Under independent Poisson sampling, \(N\sim\operatorname{Poisson}(\sum_c\mu_c)\). A fixed total arises only if the design fixes it or if the analysis explicitly conditions on it.
- Confusing cell means with observed counts. The mean \(\mu_c\) is a parameter of the distribution of \(Y_c\); it need not be an integer and need not equal the realized count.
- Using a log mean for a zero expected count without qualification. A finite loglinear predictor gives \(\mu_c=\exp(\boldsymbol{x}_c^{\mathsf T}\boldsymbol{\beta})>0\). A cell that is structurally impossible requires separate treatment rather than an ordinary finite log mean.
Check Your Understanding
Use the definitions and derivations above to answer these questions.
- What two assumptions, beyond specifying cell means, define the independent Poisson cell model?
- If three independent Poisson cell counts have means \(5,7,\) and \(8\), what is the distribution and mean of their sum?
- For independent Poisson means \(3,6,\) and \(9\), what are the cell probabilities in the distribution conditional on the grand total?
- Why does a loglinear predictor imply a positive mean for each cell when its coefficients are finite?
- A study enrolls exactly 100 participants and records each in one cell of a table. Is the grand total random under the study design? Explain how that differs from independent Poisson sampling.