Why the Independence Fit Has a Simple Form
In a two-way table, the independence model says that the row category and column category have no association in the population. The model does not require all cell counts to be equal: cells in common rows or columns may have different expected counts because the row and column totals differ. The key question is how to combine those two sets of totals into a fitted count for each cell.
The answer is a product of margins divided by the grand total. We will derive this familiar formula from independent Poisson counts, check its likelihood justification, and give a conditional interpretation. The derivation also clarifies an important detail: the formula can include zero fitted counts, even though a finite loglinear parameter cannot produce a mean of zero.
For independent Poisson cell counts, the no-association model has an additive row-and-column form on the log-mean scale. Equivalently, the mean in each cell factors into a row contribution and a column contribution. As in the earlier material on loglinear parameters and identifiability, different parameter values can encode the same collection of means; it is the fitted means that matter here.
Derivation from the Poisson Likelihood
For a Poisson random variable with mean \(\mu_{ij}\), the probability of observing \(y_{ij}\) is \(e^{-\mu_{ij}}\mu_{ij}^{y_{ij}}/y_{ij}!\). Independence across cells makes the joint likelihood the product of these probabilities. Its log-likelihood, apart from no omitted parameter-dependent terms, is
Differentiating with respect to a row effect gives the row score equation; differentiating with respect to a column effect gives the column score equation. The intercept score supplies the total-count equation. Although the intercept and effects require an identifying constraint for a unique parameter representation, these margin equations are valid for the fitted means.
Thus, at a finite maximum, the fitted counts must reproduce the observed row totals and column totals. The candidate obtained by multiplying those margins and dividing by \(N\) has exactly that property, and it belongs to the independence model.
Proof. Define \(\tilde{\mu}_{ij}=R_iC_j/N\). This candidate is positive under the stated conditions, and it has the required factorization:
It therefore belongs to the independence model. Its row sums are
and its column sums are
Consequently, every row and column score is zero at \(\tilde{\mu}\). To establish that this is a maximum, use identifiable loglinear coordinates, such as an intercept and row and column effects with reference levels fixed. The log-likelihood is concave in those coordinates: its Hessian has the form \(-X^{\mathsf T}WX\), where \(X\) is the model matrix and \(W\) is diagonal with positive entries \(\mu_{ij}\). A stationary point of a concave function is a global maximum. With the stated positive margins, the design has full column rank after imposing the identifying constraints, so the Hessian is negative definite and the fitted means are unique. Hence \(\hat{\mu}_{ij}=\tilde{\mu}_{ij}\). \(\square\)
Worked Calculations
Worked Example: A Two-by-Three Table
Suppose the observed table is
| Column 1 | Column 2 | Column 3 | Row total | |
|---|---|---|---|---|
| Row 1 | 12 | 8 | 10 | 30 |
| Row 2 | 6 | 9 | 5 | 20 |
| Column total | 18 | 17 | 15 | 50 |
For Row 1 and Column 1, the fitted count is \(30(18)/50=10.8\). Applying the same calculation to every cell gives
The fitted Row 1 total is \(10.8+10.2+9=30\), and the fitted Row 2 total is \(7.2+6.8+6=20\). The fitted column totals are \(10.8+7.2=18\), \(10.2+6.8=17\), and \(9+6=15\); all match the observed margins. The fitted counts need not be integers because they are estimated means, not new observed counts.
Worked Example: Checking the Likelihood Equations
Consider the observed table
Both row totals and both column totals are 20, and \(N=40\). The formula gives \(\hat{\mu}_{ij}=20(20)/40=10\) in every cell. Check the score equations directly. For the first row, the observed total minus fitted total is \(16+4-(10+10)=0\); for the second row it is \(4+16-(10+10)=0\). For the first column it is \(16+4-(10+10)=0\), and for the second it is \(4+16-(10+10)=0\). The intercept score is also zero because the observed and fitted grand totals are both 40. Thus the proposed fitted counts satisfy the likelihood equations, and the concavity argument establishes that they maximize the likelihood.
A Conditional Interpretation
The same product-of-margins calculation has a useful interpretation that does not require differentiating a likelihood. Imagine \(N\) labeled positions, with \(R_i\) positions assigned to row \(i\). Under independence, column labels are assigned independently of row labels. Conditional on the observed column totals \(C_1,\ldots,C_J\), all assignments of those column labels to the \(N\) positions are equally likely: under the independence model, each assignment has the same probability once those totals are fixed.
Proof. For each of the \(R_i\) positions in row \(i\), define an indicator that equals 1 if its column label is \(j\) and 0 otherwise. Conditional on the column totals, the uniform assignment makes the probability of label \(j\) at any one position \(C_j/N\): exactly \(C_j\) of the \(N\) labels are \(j\). The cell count is the sum of these \(R_i\) indicators. By linearity of expectation,
This conditional mean is the same numerical quantity as the Poisson maximum-likelihood fitted count. The interpretation is useful, but it is not a claim that every cell count must equal its conditional expectation in an observed table. \(\square\)
Worked Example: A Zero Cell With Positive Margins
Suppose the observed table is
The row totals are \(R_1=6\) and \(R_2=6\); the column totals are \(C_1=4\) and \(C_2=8\); and \(N=12\). The fitted counts are
In particular, the observed zero in the first cell has a fitted count of 2, not 0. The formula depends on the margins, not on copying individual observed cell counts. The fitted row totals are \(2+4=6\) in each row, and the fitted column totals are \(2+2=4\) and \(4+4=8\), as required.
Zero Margins and the Boundary
The formula also describes the limiting fit when a row or column total is zero. For example, if \(R_i=0\), then every observed count in row \(i\) is zero, and \(R_iC_j/N=0\) for every column. However, a finite loglinear predictor always gives \(\exp(\lambda+\alpha_i+\beta_j)>0\). Such a zero fitted mean is therefore a boundary value: it can be approached as a row effect tends to negative infinity, but not attained using finite loglinear coefficients. The same reasoning applies to a zero column total. If all counts are zero, \(N=0\), so the product-over-grand-total expression is undefined; the likelihood is maximized in the closure of the model by setting all fitted means to zero.
Worked Example: A Zero-Margin Row
Take the table
Its row totals are \(0,6,12\), its column totals are \(6,3,9\), and \(N=18\). The product-of-margins calculation gives
The first fitted row is zero because its observed row total is zero. The other fitted rows are positive and have the observed column totals when combined. The zero row is a boundary fit, not a finite-parameter Poisson mean.
Common Mistakes and Why the Formula Matters
- Using only one margin. The incorrect reasoning is that a cell's fitted count should be its row total or its column total. That would assign the entire margin to one cell. The independence fit uses both margins and divides by \(N\): \(\hat{\mu}_{ij}=R_iC_j/N\).
- Copying the observed cell count. A zero observed count does not force a zero fitted count, as the preceding example shows. The fitted count is determined by the model and the margins.
- Using the wrong denominator. Dividing by \(R_i\) or \(C_j\) alone produces a conditional proportion or a rescaling, not an expected cell count. The product \(R_iC_j\) has to be divided by the grand total to recover the correct count scale.
- Assuming all fitted counts are positive. Positive margins give positive fitted counts, but a zero margin gives boundary fitted counts of zero. Do not claim that finite loglinear coefficients represent those zeros.
This derivation matters because the fitted table is the reference point for assessing how observed counts differ from what independence predicts. It also makes the role of the margins transparent: the independence fit preserves them exactly, while distributing each row total across columns in proportion to the column totals. Later comparisons of observed and fitted tables use this fit as their baseline.
Check Your Understanding
Use the margin formula and the likelihood or conditional interpretation to answer these questions.
- A table has row total 24, column total 15, and grand total 60 for a particular cell. What is its independence fitted count?
- Why do the fitted counts under independence reproduce every observed row and column total?
- In the table \(\begin{pmatrix}0&6\\4&2\end{pmatrix}\), why is the fitted count in the observed zero cell not zero?
- What does a zero row total imply for the fitted counts in that row, and why can those fitted means not arise from finite loglinear coefficients?
- Explain how conditioning on the column totals leads to the expected count \(R_iC_j/N\) for cell \((i,j)\).