Tutorials › Generalized Linear Models › Common Errors in Loglinear Model Interpretation

Poisson Loglinear Models · Tutorial 466 of 981

Common Errors in Loglinear Model Interpretation

Learn to diagnose common loglinear interpretation errors by checking the model contrast, reference constraints, cell status, and conditioning set.

Intermediate 12 min read

What You'll Learn

  • Explain why an interaction coefficient’s meaning depends on the parameter constraints.
  • Derive the two-way loglinear interaction contrast and its odds-ratio interpretation.
  • Distinguish an observed zero from a structural zero and a zero fitted mean.
  • Recognize how marginal association can differ from conditional association.
  • Interpret fitted Poisson counts as model-based expected counts, not probabilities or observed values.

Why Interpretation Requires More Than Reading a Coefficient

A loglinear model describes expected counts in a contingency table. Its parameters can summarize association, but their meanings depend on how the model is parameterized and which variables are held fixed. A coefficient read without those details can be misleading: an interaction parameter may not equal a log odds ratio, an observed zero need not imply a zero expected count, and an association in a marginal table need not match the association within strata.

Let \(Y_{ij}\) denote the observed count in cell \((i,j)\), and let \(\mu_{ij}=E[Y_{ij}]\) be its expected count. In the usual Poisson formulation, the cell counts are modeled as independent Poisson random variables. A fitted count, written \(\hat{\mu}_{ij}\), is the estimate of that expected count under the specified model. Keeping the observed count, expected count, fitted count, and parameter contrast distinct prevents several common errors.

Interaction Parameters and Reference Constraints

Consider a two-way table with two categories for each variable, labelled 0 and 1. A saturated loglinear model can be written

$$ \log \mu_{ij}=\lambda+\alpha_i+\beta_j+\gamma_{ij}. $$

This expression alone does not uniquely determine the parameters: constants can be shifted among the terms without changing any fitted cell mean. Identifiability is obtained by imposing constraints. Different valid constraints give different numerical parameter values, even though they can describe the same four means.

Under reference-cell constraints, set \(\alpha_0=\beta_0=0\) and set \(\gamma_{i0}=\gamma_{0j}=0\). The interaction parameter for cell \((1,1)\) is then a particular contrast. Under sum-to-zero constraints, the main-effect parameters sum to zero across their categories and the interaction parameters sum to zero across each row and column. The resulting interaction coefficient is generally not the same number as the reference-cell coefficient.

Key result: In a two-by-two table, the coding-invariant interaction contrast is \( \log\mu_{11}-\log\mu_{10}-\log\mu_{01}+\log\mu_{00} \). It equals the log cross-product ratio. A coefficient labelled “interaction” equals this contrast only when the parameterization makes it so.

To verify the result, substitute the loglinear expression into the contrast. The intercept and each main effect cancel:

$$ \begin{aligned} &\log\mu_{11}-\log\mu_{10}-\log\mu_{01}+\log\mu_{00}\\ &=(\lambda+\alpha_1+\beta_1+\gamma_{11}) -(\lambda+\alpha_1+\beta_0+\gamma_{10})\\ &\quad-(\lambda+\alpha_0+\beta_1+\gamma_{01}) +(\lambda+\alpha_0+\beta_0+\gamma_{00})\\ &=\gamma_{11}-\gamma_{10}-\gamma_{01}+\gamma_{00}. \end{aligned} $$

Exponentiating the contrast gives \( \mu_{11}\mu_{00}/(\mu_{10}\mu_{01}) \), the cross-product ratio of the expected counts. With reference-cell constraints, the contrast reduces to \(\gamma_{11}\). With sum-to-zero constraints in a two-by-two table, the interaction entries have the pattern \(g,-g,-g,g\), so the contrast is \(4g\), not \(g\). The contrast is unchanged by the choice of constraints, while the coefficient itself is not. This derivation assumes all four means are positive, so their logarithms are defined. \(\square\)

Worked Example: A Coefficient Is Not Always the Log Odds Ratio

Suppose a two-by-two model has expected counts \(\mu_{00}=10\), \(\mu_{10}=20\), \(\mu_{01}=15\), and \(\mu_{11}=60\). Find the interaction contrast, then compare its value with the coefficient under reference-cell and sum-to-zero constraints.

The contrast is \( \log(60)-\log(20)-\log(15)+\log(10) =\log\{(60)(10)/[(20)(15)]\}=\log 2 \). The corresponding cross-product ratio is 2.

Under reference-cell constraints, \(\gamma_{11}=\log 2\). Under sum-to-zero constraints, write the interaction entries as \((g,-g;-g,g)\). Their contrast is \(g-(-g)-(-g)+g=4g\), so \(g=(\log 2)/4\), approximately 0.1733. Both parameterizations yield the same interaction contrast and expected counts. Reporting the sum-to-zero coefficient itself as the log odds ratio would therefore be incorrect.

Observed Zero Counts and Model Means

A zero in the data is an observed count \(Y_{ij}=0\); it is not automatically a cell whose model mean is zero. For a Poisson count with mean \(\mu>0\), the log-likelihood contribution, apart from no omitted terms, is

$$ \ell(\mu;y)=y\log\mu-\mu-\log(y!). $$

When \(y=0\), the contribution is \(-\mu\), because \(0\log\mu\) is taken as 0. For every finite log-mean parameter, \(\mu=\exp(\eta)>0\), so the model can assign a positive expected count to an observed-zero cell. In a saturated model with a free mean for each cell, the likelihood is maximized at \(\hat{\mu}=y\). For a zero observation this is the boundary value \(\hat{\mu}=0\), which cannot be represented by a finite log-mean, since \(\log 0\) is undefined.

This distinction matters: fitting a model with shared parameters can give a positive fitted mean for a cell observed as zero. Conversely, a structural zero means the cell is impossible by design or definition, not merely unobserved in this sample. A structural zero should not be treated as an ordinary Poisson observation with a small count; the model and table’s sample space must account for the impossibility. If an entire row or column has zero total, the data also provide no observed counts in that category, and some contrasts may be unestimable. Such a situation is not repaired by interpreting the zero as evidence of a precisely estimated zero mean.

Worked Example: What a Zero Cell Does and Does Not Say

A cell has observed count \(y=0\), and a fitted loglinear model assigns it mean \(\hat{\mu}=0.8\). Calculate its fitted probability of zero and explain whether the model is inconsistent with the observation.

For a Poisson variable with mean 0.8, \(P(Y=0)=e^{-0.8}0.8^0/0!=e^{-0.8}\approx0.4493\). Thus observing zero is quite compatible with this fitted mean; the expected count is not a promise that the realized count will equal it.

The cell’s log-likelihood contribution at \(\hat{\mu}=0.8\) is \(-0.8\). In contrast, if a separate saturated mean were estimated for this cell alone, the likelihood supremum would occur at \(\hat{\mu}=0\). That boundary estimate is a feature of the saturated fit to this observed zero, not a general conclusion that the cell is structurally impossible or that a constrained model must assign it zero mean.

Conditional and Marginal Association Are Different Questions

An association described by a loglinear interaction is tied to the variables and conditioning structure in the model. In a three-way table, a two-factor association can be conditional on the third variable. The association in a table formed by summing over that third variable is marginal. These are different summaries, and they need not agree in strength or even direction.

The following table gives counts for exposure and outcome in two strata. Within each stratum, the odds ratio comparing exposed with unexposed is greater than 1. After summing over strata, the marginal odds ratio is less than 1.

StratumExposureOutcome: YesOutcome: No
High baselineExposed91
High baselineUnexposed8020
Low baselineExposed2080
Low baselineUnexposed19
Marginal totalsExposed2981
Marginal totalsUnexposed8129

Worked Example: A Reversal After Marginalizing

Compute the conditional odds ratios in the two strata and the marginal odds ratio after summing the counts.

In the high-baseline stratum, the odds ratio is \( (9\times20)/(1\times80)=180/80=2.25 \). In the low-baseline stratum, it is \( (20\times9)/(80\times1)=180/80=2.25 \). Thus the conditional odds ratios agree and both favor higher outcome odds among the exposed.

After summing, exposed individuals have 29 “Yes” and 81 “No” outcomes; unexposed individuals have 81 “Yes” and 29 “No.” The marginal odds ratio is \( (29\times29)/(81\times81)=841/6561\approx0.128 \). It is below 1, the opposite direction from either stratum-specific odds ratio.

The reversal occurs because the exposure groups have different distributions across the high- and low-baseline strata. It does not make either calculation arithmetically wrong: one is conditional and the other marginal. A model statement about conditional association must not be reported as if it described the association after summing over strata.

Fitted Counts Are Expected Counts Under a Model

A fitted count \( \hat{\mu}_{ij} \) is the model’s estimated expected count for a cell. It is not the observed count, an individual-level prediction, or a probability. It may be fractional, since an expectation need not be an integer. Its interpretation also depends on which model was fitted. For example, under independence in a two-way table, the fitted count is the product of the corresponding observed marginal totals divided by the grand total. That model-based quantity summarizes the table under the independence restriction; it is not simply a rescaled observed cell count.

Worked Example: Fractional Fitted Counts Under Independence

The observed two-by-two table is

Column 1Column 2Row total
Row 1123
Row 2134
Column total257

Under the independence model, each fitted count is row total times column total divided by the grand total. Therefore the fitted first-row counts are \(3(2)/7=6/7\) and \(3(5)/7=15/7\). The fitted second-row counts are \(4(2)/7=8/7\) and \(4(5)/7=20/7\). These values sum to the observed row and column margins: the fitted first row sums to \(21/7=3\), and the first column sums to \(14/7=2\).

A fitted value of \(6/7\) is not an impossible fractional observation. It is the estimated mean count in that cell under the independence model. The actual observed count there is 1. Neither number is a probability: probabilities are between 0 and 1 and refer to events, whereas these fitted values are expected counts.

Common Interpretation Errors

Before interpreting a loglinear result, identify the cell means, the parameter constraints, and whether an association is conditional or marginal. Then check whether the reported quantity is an observed count, fitted mean, or contrast. The most frequent errors are avoidable once those distinctions are explicit.

  • Wrong: “The interaction coefficient is the log odds ratio in any parameterization.” Correction: Identify the constraints and calculate the interaction contrast. The contrast, not every individual coefficient, is invariant to the coding.
  • Wrong: “An observed zero means the expected count is zero.” Correction: A zero is one realization. A constrained model may assign the cell a positive fitted mean; a structural zero is a separate design condition.
  • Wrong: “The association in the summed table is the same association the model estimates within strata.” Correction: State what is conditioned on. Marginalization can change an association’s size or direction.
  • Wrong: “A fitted count is the probability of observing the cell.” Correction: It is an estimated expected count. A probability requires a specified event and a probability model.
  • Wrong: “A fractional fitted count is invalid.” Correction: Expected values can be non-integer even though observed counts are integers.
Key takeaway: Interpret the invariant contrast rather than a coefficient in isolation; distinguish observed zeros from structural impossibilities; name the conditioning set; and describe fitted counts as model-based expected counts.

Check Your Understanding

Answer each question by stating the relevant model quantity and its interpretation.

  1. In a two-by-two loglinear model with sum-to-zero constraints, why might an interaction coefficient differ from the log cross-product ratio?
  2. A cell has observed count zero but a positive fitted mean. Is this necessarily a contradiction? Explain using the Poisson probability of a zero count.
  3. In a three-way table, what is the difference between a conditional association and the corresponding marginal association?
  4. Can a fitted expected count be fractional? Explain why this does not conflict with integer-valued observations.
  5. What additional information would you need before describing a reported loglinear interaction coefficient as a log odds ratio?
Clinical Biostats