From Clustered Counts to Marginal Means
Count responses are often recorded repeatedly within the same cluster: patients within a clinic, days within a facility, or events within a study participant. The cluster members may have related outcomes, but the mean model answers a specific question: what is the expected count for a member with the stated covariates, averaging over the response variation represented by the model? A covariate measured once per cluster can enter this mean even though each cluster contributes several responses.
Let \(Y_{ij}\) be the count for member or occasion \(j\) in cluster \(i\), where \(i=1,\ldots,n\) and \(j=1,\ldots,m_i\). Let \(A_i\) denote a cluster-level exposure covariate, so that every response in cluster \(i\) shares the same value \(A_i\). The marginal mean is defined response by response, conditional on the covariates, not on the other outcomes in the cluster.
The word marginal matters here: the model is for \(E[Y_{ij}\mid\text{covariates}]\), not for the mean conditional on the other responses \(Y_{ik}\) in the same cluster. A log link is useful because it keeps fitted means positive and makes additive changes in the linear predictor into multiplicative changes in the mean. The cluster-level covariate \(A_i\) is repeated in the predictor for each response from cluster \(i\); it does not vary with \(j\).
Fitted Means and Rate Ratios
After fitting a model, replace each unknown coefficient by its estimate. In the model above, the fitted mean for covariate values \(A_i\) and \(t_{ij}\) is \(\hat{\mu}_{ij}=\exp(\hat{\beta}_0+\hat{\beta}_1A_i+\hat{\beta}_2t_{ij})\). This is a fitted expected count, not a prediction that the observed count must equal that value.
Suppose \(A_i\) is binary, with 1 indicating exposed and 0 unexposed. When the other covariates are held fixed, the response-scale comparison between these two groups is obtained by dividing their means. The logarithm of the mean ratio is the difference of their linear predictors; exponentiating gives the ratio. Consequently, without an exposure-by-time interaction, the exposure rate ratio is constant across the values of time included in the model.
Worked Example: Binary Exposure and Repeated Counts
A study records a count at two visits for each participant. Let \(A_i=1\) for participants receiving an exposure and \(A_i=0\) otherwise, and let \(t_{ij}=0\) or \(1\) mark the visit. Consider \(\log(\mu_{ij})=\beta_0+\beta_1A_i+\beta_2t_{ij}\), with \(\beta_0=\log 2\), \(\beta_1=\log 1.5\), and \(\beta_2=\log 1.2\). Calculate the four fitted means and the exposure rate ratio.
At visit 0, the unexposed mean is \(\exp(\log 2)=2\), and the exposed mean is \(\exp(\log 2+\log 1.5)=2(1.5)=3\).
At visit 1, the unexposed mean is \(\exp(\log 2+\log 1.2)=2(1.2)=2.4\), and the exposed mean is \(\exp(\log 2+\log 1.5+\log 1.2)=2(1.5)(1.2)=3.6\).
The exposure mean ratio is \(3/2=1.5\) at visit 0 and \(3.6/2.4=1.5\) at visit 1, matching \(\exp(\beta_1)=1.5\). Under equal observation periods, the exposed group has an expected count 1.5 times as large at either visit. The calculation is about the marginal means; it does not require that a participant's two counts be independent.
Worked Example: A Continuous Cluster-Level Exposure
Suppose every member of cluster \(i\) shares a measured dose \(D_i\), and the mean model is \(\log(\mu_{ij})=\beta_0+\beta_1D_i+\beta_2t_{ij}\). Take \(\beta_0=\log 4\), \(\beta_1=\log 1.25\), \(\beta_2=\log 0.9\), and evaluate at \(D_i=2\), \(t_{ij}=3\).
The fitted mean is \(\exp(\log 4+2\log 1.25+3\log 0.9)=4(1.25)^2(0.9)^3\). Since \((1.25)^2=1.5625\) and \((0.9)^3=0.729\), this is \(4(1.5625)(0.729)=4.55625\).
For a cluster with dose 0 at the same time value, the mean is \(4(0.9)^3=2.916\). The ratio is \(4.55625/2.916=1.5625=(1.25)^2\). Thus each one-unit increase in dose multiplies the modeled mean by 1.25, holding time fixed; the two-unit difference multiplies it by \(1.25^2\). This is a comparison of marginal means, not automatically a causal effect of changing dose.
Offsets and the Meaning of Exposure
The term “exposure” can refer either to a scientific covariate, such as treatment status or dose, or to the amount of time or opportunity during which a count could occur. These play different roles. A covariate such as \(A_i\) enters the linear predictor with an estimated coefficient. If observation periods differ and the target is a rate per unit of person-time \(T_{ij}>0\), a common specification includes the known offset \(\log(T_{ij})\): \(\log(\mu_{ij})=\log(T_{ij})+\beta_0+\beta_1A_i\). The offset coefficient is fixed at one. The expected count is then the observation time multiplied by the modeled rate.
Worked Example: Separating a Cluster Covariate From Person-Time
Suppose \(A_i\) is a binary cluster-level exposure and \(T_{ij}\) is the person-time for response \(j\). Use \(\log(\mu_{ij})=\log(T_{ij})+\beta_0+\beta_1A_i\), where \(\beta_0=\log 0.4\) and \(\beta_1=\log 1.5\). Calculate the expected counts for a control response with \(T_{ij}=2.5\) and an exposed response with \(T_{ij}=4\), then compare rates.
For the control response, \(\mu=2.5(0.4)=1.0\). For the exposed response, \(\mu=4(0.4)(1.5)=2.4\). The expected counts differ by a factor of 2.4, but the observation times also differ.
Dividing each mean by its person-time gives rates \(1.0/2.5=0.4\) and \(2.4/4=0.6\). Their ratio is \(0.6/0.4=1.5=\exp(\beta_1)\). The exposure coefficient compares rates, whereas the fitted means compare expected counts over the specified person-times. Treating \(T_{ij}\) as an ordinary covariate with an estimated coefficient would be a different model.
The Mean Model Does Not Specify Dependence
A shared cluster-level covariate and a shared cluster response structure are distinct ideas. The same \(A_i\) appears in several marginal means, but this does not assert that the responses are independent, nor does it tell us how strongly they are associated. One may state a marginal mean model while separately allowing the responses in a cluster to be dependent. A particular joint distribution or working dependence structure requires an additional assumption; it is not implied by the log link.
The following elementary result makes the separation explicit. Let \(S_i=\sum_{j=1}^{m_i}Y_{ij}\) be the total count in cluster \(i\), and let \(X_i\) denote the covariates for that cluster. Assume \(m_i\) is finite and the conditional means exist. If the marginal mean model gives \(E[Y_{ij}\mid X_i]=\mu_{ij}\), then linearity of conditional expectation gives the cluster-total mean regardless of within-cluster dependence.
Proof. Since \(S_i\) is a finite sum, conditional linearity of expectation applies:
For the variance, expand the square around the conditional mean. Equivalently, write \(S_i-E[S_i\mid X_i]=\sum_j(Y_{ij}-\mu_{ij})\), square this finite sum, and take its conditional expectation. Each squared term contributes \(\operatorname{Var}(Y_{ij}\mid X_i)\), while each distinct pair contributes twice its conditional covariance. Therefore
The calculation uses no independence assumption. It shows why a correct marginal mean specification alone does not determine the variability of a cluster total. \(\square\)
Common Mistakes
- Assuming a log link implies Poisson responses. It specifies the mean through \(\log(\mu_{ij})\); it does not, on its own, assert a Poisson marginal distribution or a joint distribution for the cluster.
- Calling a mean ratio a rate ratio without checking observation time. The ratio is a rate ratio when the observation periods are equal or when an appropriate offset represents differing exposure time.
- Treating a cluster-level covariate as if it varied by response. If \(A_i\) is measured once per cluster, it has the same value for all \(j\) in that cluster. Repeating it in the response-level predictor does not create additional within-cluster variation in \(A_i\).
- Reading \(\exp(\beta_1)\) as a difference in counts. It is a multiplicative comparison of means for a one-unit covariate change, holding other terms fixed. The corresponding absolute difference depends on the baseline mean.
- Inferring independence from a marginal model. A marginal mean model says what each response's conditional mean is. Dependence among responses must be described separately if it is relevant to the analysis.
Check Your Understanding
Work through these questions by distinguishing the marginal mean, its response-scale interpretation, and the dependence assumptions.
- In \(\log(\mu_{ij})=\beta_0+\beta_1A_i+\beta_2t_{ij}\), what does the index \(i\) identify, and why is \(A_i\) the same for all responses in that cluster?
- If \(\beta_1=\log(1.4)\) and \(A_i\) is binary, what is the exposed-to-unexposed mean ratio at a fixed value of time when there is no interaction?
- For a two-unit increase in a continuous cluster-level covariate with coefficient \(\beta\), what is the mean ratio, holding other covariates fixed?
- Does specifying a log-linked marginal mean imply independent Poisson counts within each cluster? Explain.
- Why can expected counts have a ratio different from the rate ratio when the compared observation periods differ?