Tutorials › Generalized Linear Mixed Models (GLMM) › GEE For Repeated Count Outcomes

GLMM Versus GEE · Tutorial 144 of 698

GEE For Repeated Count Outcomes

You will build a marginal GEE for repeated counts, choose a working correlation, and translate log-link coefficients into population-averaged rate ratios.

Intermediate 11 min read

What You'll Learn

  • Specify a marginal mean model for repeated counts using a log link.
  • Use an exposure offset to model rates rather than raw counts.
  • Distinguish the working variance from the within-cluster working correlation.
  • Select a working correlation that reflects the repeated-measure design.
  • Interpret exponentiated coefficients as population-averaged rate ratios.
  • Recognize key assumptions, diagnostics, and limitations of count GEE.

Why Use GEE for Repeated Counts?

A count measured repeatedly on the same person, clinic, or other unit is not generally independent across occasions. For example, a person who has many symptom episodes during one period may also tend to have many in the next. A model that treats every count as independent can give misleading uncertainty estimates, even when its mean predictions are sensible. Generalized estimating equations (GEE) address this dependence while modeling the mean count directly.

The target is a marginal mean: the expected count for a specified covariate pattern, averaged over the population represented by the clusters. A log link makes effects multiplicative on the mean scale. When an observation represents a rate over a known amount of exposure time, an offset lets the model distinguish event rate from time at risk.

Definition: For clusters \(i=1,\ldots,m\), let \(Y_{ij}\) be the nonnegative count for occasion \(j=1,\ldots,n_i\), and let \(x_{ij}\) be its covariate vector. A marginal log-link mean model specifies $$ \mu_{ij}=E(Y_{ij}\mid x_{ij}), \qquad \log(\mu_{ij})=x_{ij}^{T}\beta. $$ If \(t_{ij}>0\) is the exposure amount, the rate model is $$ \log(\mu_{ij})=\log(t_{ij})+x_{ij}^{T}\beta, $$ where \(\log(t_{ij})\) is an offset with coefficient fixed at 1. The parameter vector \(\beta\) describes the marginal mean, not a cluster-specific latent effect.

Mean, Variance, and Working Correlation

A GEE analysis separates the mean specification from a working model for the covariance among repeated outcomes. A common starting point for counts is the Poisson variance function, \(v(\mu_{ij})=\mu_{ij}\). This choice does not require the entire joint distribution of the counts to be Poisson. It supplies a variance structure for constructing the estimating equations. If count variability exceeds the Poisson variance, a scale factor or another working variance function can be considered.

Let \(Y_i\) be the vector of counts in cluster \(i\), \(\mu_i\) the corresponding vector of marginal means, and \(D_i=\partial\mu_i/\partial\beta^T\) the derivative matrix. Write \(A_i\) for a diagonal matrix whose entries are the working variances \(v(\mu_{ij})\). A commonly used working covariance is

$$ V_i=\phi A_i^{1/2}R_i(\alpha)A_i^{1/2}, $$

where \(\phi\) is a scale parameter and \(R_i(\alpha)\) is the working correlation matrix. For a Poisson working variance, the diagonal entries of \(A_i\) are \(\mu_{ij}\). The correlation structure should match the observation design and be a valid correlation matrix. Typical choices include independence, exchangeable, AR(1), and unstructured working correlations. They describe dependence within a cluster; clusters themselves are assumed independent.

The GEE estimate \(\hat{\beta}\) solves

$$ \sum_{i=1}^{m}D_i^{T}V_i^{-1}(Y_i-\mu_i)=0. $$

The working correlation affects how observations are weighted and can affect efficiency. With a correctly specified marginal mean and independent clusters, the estimating equation has expectation zero even if the working correlation is not the true correlation. In practice, inference commonly uses the sandwich variance, which protects large-sample standard errors against misspecification of the working covariance. It does not protect against a misspecified mean model or dependence between clusters.

Why the Estimating Equation Targets the Marginal Mean

The key justification is short. Suppose the conditional mean model is correct, so \(E(Y_i\mid X_i)=\mu_i\), where \(X_i\) denotes the covariates for cluster \(i\). Treating the covariates and working covariance as fixed when taking the expectation gives

$$ E\left[D_i^TV_i^{-1}(Y_i-\mu_i)\mid X_i\right] =D_i^TV_i^{-1}\{E(Y_i\mid X_i)-\mu_i\} =D_i^TV_i^{-1}(\mu_i-\mu_i)=0. $$

Thus the mean parameter solves an unbiased estimating equation at its true value, without requiring \(V_i\) to equal the true covariance matrix. Independent clusters allow the cluster contributions to accumulate as the number of clusters grows. The robust sandwich variance estimates uncertainty from the observed variability of those contributions. This large-sample justification depends on having enough independent clusters; a large number of repeated measurements within only a few clusters does not substitute for a large number of clusters.

Working Example: A Population-Averaged Rate Ratio

Worked Example: Interpreting a Treatment Coefficient

Suppose a hypothetical study records a symptom count at four visits for each of 120 independent participants. Treatment is assigned at the participant level. A log-link GEE includes treatment and visit as covariates, uses a Poisson working variance and an exchangeable working correlation, and reports a treatment coefficient of \(\hat{\beta}_{T}=-0.2231\) with robust \(SE=0.0900\). Assume the marginal mean form is appropriate, the treatment groups are represented at the visits being compared, and participants are independent of one another.

The estimated treatment-to-control mean count ratio at the same visit is

$$ \exp(\hat{\beta}_{T})=\exp(-0.2231)=0.8000. $$

Thus the estimated population-averaged mean symptom count per visit is 0.80 times as large in the treatment group as in the control group, holding visit fixed. Equivalently, the estimated mean count is 20.0% lower. This is a marginal comparison, not a comparison conditional on a participant-specific random effect.

For a two-sided Wald test of \(H_0:\beta_T=0\), the statistic is

$$ z=\frac{-0.2231}{0.0900}=-2.479. $$

The approximate two-sided p-value is 0.0132. At significance level \(\alpha=0.05\), this is evidence against a zero marginal treatment coefficient under the model and large-sample inference assumptions. A 95% Wald interval for the log rate ratio is

$$ -0.2231\pm1.96(0.0900)=[-0.3995,-0.0467]. $$

Exponentiating the endpoints gives a 95% confidence interval for the population-averaged mean ratio of \([0.671,0.954]\). In context, the interval estimates a treatment-group mean count between 0.671 and 0.954 times the control-group mean count at the same visit. Its repeated-sampling interpretation concerns the procedure, not a probability that this particular interval contains the fixed parameter.

Choosing a Working Correlation

The working correlation should reflect how occasions are organized, while remaining parsimonious enough to estimate reliably. Independence is a reasonable baseline and can still yield valid robust inference under the mean and cluster-independence assumptions. Exchangeable correlation assigns one common correlation to every pair of occasions in a cluster. AR(1) assigns correlations that decay with the lag between equally spaced occasions. An unstructured correlation estimates a separate correlation for each pair and can require many parameters, especially with many occasions.

Worked Example: Matching Correlation to Visit Timing

In a hypothetical symptom-count study, participants are assessed at three equally spaced monthly visits. After fitting a plausible marginal mean model, suppose the observed adjacent-visit correlations of standardized residuals are approximately 0.48 and 0.52, while the correlation between visits one and three is approximately 0.25. These are diagnostic summaries, not proof of a true correlation structure.

An AR(1) working correlation with adjacent correlation \(\alpha=0.50\) implies lag-two correlation \(\alpha^2=0.50^2=0.25\). Its implied pattern therefore accords with these summaries and the equally spaced visit schedule. An exchangeable structure with correlation 0.50 would instead imply a lag-two correlation of 0.50, so it fits the displayed pattern less closely. Independence would ignore the apparent positive association; an unstructured choice is possible with only three visits, but it estimates more correlations than AR(1).

The working correlation should be chosen using the design and residual diagnostics, not by mechanically selecting the largest empirical correlation. The mean model, number of independent clusters, and stability of estimation remain important. If visits were irregularly spaced, the usual discrete-time AR(1) pattern would not represent distance in time in the same way.

Offsets: Modeling Rates Rather Than Totals

Counts are comparable as rates only when their exposure amounts are equal or are accounted for. In the offset model, \(\log(t_{ij})\) enters with its coefficient fixed at 1, so \(\mu_{ij}/t_{ij}\) is the modeled event rate per unit of exposure. The offset is appropriate when exposure is known and the expected count is proportional to exposure, conditional on the other covariates. It is not a general remedy for unequal follow-up when exposure itself is related to the outcome process in a way the model does not capture.

Worked Example: Adjusting for Different Follow-Up Time

Suppose a hypothetical repeated-count analysis models hospital visits, with follow-up measured in person-weeks. The fitted rate model has a control-group rate of 0.40 visits per person-week and a treatment rate ratio of 0.75. Both groups are observed repeatedly, and the GEE accounts for within-person dependence using an exchangeable working correlation. Assume the log-linear exposure relationship and marginal mean specification are reasonable.

For one control participant observed for one week, the model gives

$$ \hat{\mu}_{C}=1(0.40)=0.40\text{ expected visits}. $$

For a treated participant observed for four weeks, the expected count is

$$ \hat{\mu}_{T}=4(0.40)(0.75)=1.20\text{ expected visits}. $$

The treated participant has a larger expected total because the follow-up is longer, but the estimated rate ratio remains \(1.20/4\div(0.40/1)=0.75\). It would be incorrect to interpret the ratio of the expected totals, \(1.20/0.40=3.00\), as the treatment rate ratio: the exposure amounts differ.

Inference, Diagnostics, and Alternatives

GEE inference relies on independent clusters, a correctly specified marginal mean, suitable covariate information, and a sufficiently large number of clusters for the sandwich approximation. The working variance and correlation need not be exactly correct for consistency of the mean estimate under these conditions, but poor choices can reduce efficiency or cause numerical problems. A robust standard error is not a cure for a poor mean model, informative cluster size, or dependence between clusters.

Useful checks include comparing observed and fitted mean counts across covariate groups and occasions, examining residual patterns against fitted means and time, and assessing whether extra-Poisson variation is substantial. Check that the chosen working correlation is positive definite and that estimates converge without implausible parameters or unstable standard errors. A large difference between model-based and robust standard errors can signal covariance misspecification, although it does not by itself identify the problem. With few clusters, ordinary sandwich inference can be unreliable.

The main alternatives answer different practical needs. An independence working correlation is simple and may be robustly valid for mean inference, but can lose efficiency when dependence is strong. More elaborate working correlations can improve efficiency if they represent the data well, at the cost of additional estimation and possible instability. An independent-observation Poisson GLM does not account for within-cluster dependence in its usual standard errors. A GLMM instead introduces cluster-specific random effects and gives conditional interpretations; it is not interchangeable with a marginal GEE merely by changing the standard errors. The earlier material on GLM provides the baseline generalized linear model framework, while GEE supplies a marginal approach for clustered observations.

Common pitfall: “The treatment coefficient is \(-0.223\), so treatment reduces the count by 0.223 visits.” This confuses the log-mean scale with the count scale. Exponentiate the coefficient: \(\exp(-0.223)\approx0.800\), a population-averaged mean ratio. Also state the modeled unit—such as counts per visit or rates per person-week—because an offset changes the interpretation from total counts to rates.

A final limitation is that GEE estimates a population-averaged association for the specified covariates and mean structure. It does not provide a full joint probability model for all counts, and its predictions are not individual-specific latent-effect predictions. Count data with many zeros, severe overdispersion, or complex exposure processes may require additional modeling decisions; the mean, variance, and correlation assumptions should be inspected rather than accepted automatically.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A repeated-count GEE has treatment coefficient \(\hat{\beta}=0.1823\). What is the estimated population-averaged mean ratio, and how should it be interpreted?
  2. For an exposure of 3 person-days, the fitted baseline rate is 0.20 events per person-day and the treatment rate ratio is 0.50. What is the fitted expected count for a treated observation?
  3. With equally spaced visits, an AR(1) working correlation has adjacent correlation 0.60. What correlation does it imply two visits apart?
  4. State two assumptions needed for the usual large-sample robust GEE inference.
  5. Why does a robust sandwich standard error not make a misspecified mean model acceptable?

Solutions. (1) \(\exp(0.1823)=1.200\), so the expected count is estimated to be 1.20 times the comparison-group mean at the same covariate values, a 20.0% higher population-averaged mean. (2) The expected count is \(3(0.20)(0.50)=0.300\) events. (3) The lag-two correlation is \(0.60^2=0.360\). (4) Examples include independent clusters, a correctly specified marginal mean, and enough independent clusters for the sandwich approximation. (5) The sandwich estimates uncertainty around the estimating-equation target; if the mean is wrong, that target need not equal the intended population mean effect.

Clinical Biostats