Tutorials › Competing Risks and Multi-State Models › GEE Models For Recurrent Event Counts

Recurrent-Event Estimands and Models · Tutorial 595 of 699

GEE Models For Recurrent Event Counts

Formulate a marginal count GEE for recurrent events, interpret its mean and working correlation, and see how the estimating equation uses repeated interval counts.

Advanced 13 min read

What You'll Learn

  • Define the subject-level count vector and the marginal mean model for repeated intervals.
  • Formulate the GEE using a mean derivative matrix and a working covariance matrix.
  • Interpret log-link coefficients and exposure offsets on the marginal mean scale.
  • Distinguish a working correlation from a model for event order or event hazard.
  • Identify assumptions, diagnostics, and failure modes that affect GEE inference.
  • Compare independence, exchangeable, and other working-correlation choices.

Why Use a GEE for Repeated Event Counts?

A recurrent-event data set can be organized as a count for each subject in each follow-up interval. For example, a study may record how many symptom episodes each participant experiences in each month. Counts from the same participant are generally dependent: a participant with many episodes in one month may also tend to have many in another. Treating all participant-months as independent can therefore give unreliable standard errors.

A generalized estimating equation (GEE) represents the mean count in each interval and uses a working covariance matrix to account for within-subject dependence. Its central target is a marginal mean: the expected count in an interval for subjects with specified covariates, averaged over the population variation not included in those covariates. The working correlation helps estimate that mean model efficiently and calculate appropriate uncertainty; it is not itself a model for the sequence of event times.

Definition: For subject \(i=1,\ldots,n\), let \(Y_{ij}\) be the event count in interval \(j=1,\ldots,m_i\), and collect the counts in the vector \(Y_i=(Y_{i1},\ldots,Y_{im_i})^\top\). Let \(X_{ij}\) be the covariate vector and \(E_{ij}\) the observed exposure in that interval. A marginal mean model specifies \(\mu_{ij}=E(Y_{ij}\mid X_{ij},E_{ij})\) as a function of those observed predictors, without requiring the counts within a subject to be independent.

Mean Model and Estimating Equation

A common specification for counts is a log-link model with an exposure offset:

$$ \log(\mu_{ij})=\log(E_{ij})+X_{ij}^{\top}\beta, \qquad \mu_{ij}=E_{ij}\exp(X_{ij}^{\top}\beta). $$

Here \(\beta\) is the vector of regression coefficients. The offset \(\log(E_{ij})\) has coefficient fixed at one; it adjusts the expected count for the amount of time or other exposure observed. If every interval has the same exposure, the offset may be omitted or absorbed into the intercept. With an offset, \(\exp(X_{ij}^{\top}\beta)\) is the modeled mean count per unit exposure. Without one, the model describes the expected count over the interval represented by the data.

For each subject, write \(\mu_i=(\mu_{i1},\ldots,\mu_{im_i})^\top\) and define \(D_i=\partial\mu_i/\partial\beta^\top\), the matrix of derivatives of the mean vector with respect to the coefficients. A working covariance matrix has the form \(V_i=A_i^{1/2}R_i(\alpha)A_i^{1/2}\), where \(A_i\) is diagonal and contains the marginal variance-function values, and \(R_i(\alpha)\) is a chosen working correlation matrix. Under a Poisson variance function, \(A_i=\operatorname{diag}(\mu_{i1},\ldots,\mu_{im_i})\). Other variance functions can be used when they better represent marginal dispersion.

Definition: The GEE for \(\beta\) is
$$ U(\beta)=\sum_{i=1}^{n}D_i^\top V_i^{-1}(Y_i-\mu_i)=0. $$
The estimate \(\hat\beta\) is a solution to this system. The working covariance combines a marginal variance specification with a chosen within-subject correlation structure.

This equation can be understood as a weighted residual condition. The residual vector \(Y_i-\mu_i\) is scaled and combined across intervals using \(V_i^{-1}\); \(D_i^\top\) then projects those weighted residuals onto the directions in which changing \(\beta\) changes the mean. The estimate is reached when the summed projected residuals are zero. If \(V_i\) is the true covariance, this weighting can improve precision. If it is only an approximation, the mean equation can still estimate \(\beta\) consistently under the assumptions below, while robust variance estimation accounts for the actual within-subject variability.

Assumptions and Inference

The usual large-sample justification requires independent subjects (clusters), a correctly specified marginal mean model, and enough independent subjects for the cluster-level estimating equation to be well approximated by its large-sample distribution. Within a subject, counts may be dependent. The chosen \(V_i\) must be invertible for the observed data and should be a reasonable working covariance; it need not equal the true covariance for consistency of the mean estimator. Covariates and exposure must be measured appropriately, and the observed intervals must represent the target follow-up. Informative loss of intervals or follow-up requires additional assumptions or methods; a working correlation alone does not correct it.

The model may use a Poisson variance function even when the counts are not Poisson distributed, provided the mean is correctly specified and robust inference is used. In that case the Poisson variance is a working choice, not a claim that the full count distribution is Poisson. A common large-sample robust covariance estimator has the sandwich form

$$ \widehat{\operatorname{Var}}(\hat\beta) = \hat H^{-1}\hat B\hat H^{-1}, \qquad \hat H=\sum_i D_i^\top \hat V_i^{-1}D_i, \qquad \hat B=\sum_i \hat U_i\hat U_i^\top, $$

where \(\hat U_i=D_i^\top\hat V_i^{-1}(Y_i-\hat\mu_i)\) is the fitted contribution from subject \(i\). This variance estimate allows the actual covariance within subjects to differ from the working covariance, provided the mean model and independent-cluster large-sample conditions hold. It does not protect against a misspecified mean model, dependent subjects, or a very small number of clusters. Robust variance in marginal rate models is covered in the earlier material on robust variance in marginal rate models.

Worked Example: Intercept-Only Mean Count

Suppose four hypothetical participants each contribute two intervals with equal exposure. Their interval counts are \((0,1)\), \((2,1)\), \((3,0)\), and \((1,2)\). Use an intercept-only log-link mean model and working independence with a Poisson variance function. The subjects, rather than the eight intervals, are the independent clusters.

The total number of events is \(0+1+2+1+3+0+1+2=10\), across eight intervals. In this intercept-only model, \(\mu_{ij}=\exp(\beta)\). Under working independence, the GEE reduces to

$$ \sum_{i,j}(Y_{ij}-\mu)=0, \qquad 10-8\mu=0. $$

Thus \(\hat\mu=10/8=1.25\) events per interval and \(\hat\beta=\log(1.25)=0.2231\). The fitted common marginal mean count is 1.25 events per interval. This is not a covariate effect: the model has no covariate contrast. If intervals had different exposure, an offset would be needed to interpret the fitted mean per unit exposure.

The example illustrates the point estimate, not its uncertainty. Repeated counts from the same participant may be correlated, so treating all eight counts as independent for standard-error calculation would ignore clustering. The subject-level robust variance uses each participant's joint residual contribution.

Working Correlation: What It Does and Does Not Say

The working correlation describes the dependence pattern used in \(R_i(\alpha)\), conditional on the fitted marginal means and variance function. Common choices include:

  • Independence: \(R_i\) is the identity matrix. It assumes no within-subject correlation for weighting, but the robust variance can still account for actual clustering.
  • Exchangeable: all distinct intervals within a subject have the same working correlation \(\alpha\).
  • AR(1): the working correlation between intervals decreases with their separation, typically as \(\alpha^{|j-k|}\).
  • Unstructured: each pair of intervals has its own working correlation, requiring substantially more information and a positive-definite estimate.

These are alternative covariance approximations, not alternative marginal mean estimands. A working correlation is not a claim that one event causes another, nor does it encode a model for event order. A complicated structure is not automatically better: it can be unstable or non-positive-definite, especially with few subjects or many intervals. Independence is often a useful starting point, while a plausible simpler structure may improve efficiency.

Worked Example: Interpreting an Exchangeable Working Correlation

For a hypothetical participant with two intervals, suppose the fitted Poisson marginal means are \(\mu_{i1}=1\) and \(\mu_{i2}=2\), and the chosen exchangeable working correlation is \(\alpha=0.40\). Then \(A_i=\operatorname{diag}(1,2)\) and

$$ R_i= \begin{pmatrix} 1&0.40\\ 0.40&1 \end{pmatrix}, \qquad V_i= \begin{pmatrix} 1&0.40\sqrt{2}\\ 0.40\sqrt{2}&2 \end{pmatrix} \approx \begin{pmatrix} 1&0.5657\\ 0.5657&2 \end{pmatrix}. $$

The diagonal entries are the working marginal variances, 1 and 2. The off-diagonal entry is the working covariance, \(0.40\sqrt{1\cdot2}=0.5657\); it follows from the chosen correlation and marginal variances. The eigenvalues of \(R_i\) are \(1-0.40=0.60\) and \(1+0.40=1.40\), so this two-interval correlation matrix is positive definite. Under this working structure, the variance of the sum of the two counts is \(1+2+2(0.5657)=4.131\), compared with 3 under working independence. This calculation describes the working covariance used in estimation; it does not establish that the true correlation is 0.40.

Worked Rate Model With a Treatment Indicator

Worked Example: Marginal Rates From Repeated Counts

Consider a hypothetical study with three control and three treated participants. Each contributes two intervals, each with one unit of exposure. Control counts are \((0,1)\), \((1,0)\), and \((1,1)\); treated counts are \((1,1)\), \((2,0)\), and \((1,1)\). Let \(Z_i=0\) for control and \(Z_i=1\) for treatment. Use the mean model \(\log(\mu_{ij})=\log(E_{ij})+\beta_0+\beta_1Z_i\), with \(E_{ij}=1\), working independence, and a Poisson variance function.

With a binary group indicator, the working-independence equations set the fitted total mean equal to the observed total in each group. The control group has 4 events over 6 units of exposure, and the treated group has 6 events over 6 units. Therefore,

$$ \exp(\hat\beta_0)=\frac{4}{6}=\frac{2}{3}, \qquad \exp(\hat\beta_0+\hat\beta_1)=\frac{6}{6}=1. $$

It follows that \(\hat\beta_0=\log(2/3)=-0.4055\) and \(\hat\beta_1=\log(1/(2/3))=\log(1.5)=0.4055\). Under this specified marginal mean model, the estimated mean counts per unit exposure are 0.667 for control and 1.00 for treatment; the fitted marginal mean ratio is \(\exp(\hat\beta_1)=1.50\). These are model-based comparisons of mean counts per unit exposure. The six intervals within each group do not constitute six independent participants; inference must respect the six subject-level clusters.

Diagnostics, Comparisons, and Limitations

Check whether the fitted means are plausible across covariate patterns and intervals, whether residuals show systematic trends, and whether estimated working correlations are stable and admissible. Large residuals or patterns over time may indicate an inadequate mean model, an unsuitable variance function, or influential subjects. A correlation estimate at a boundary, failed matrix inversion, or substantial changes across plausible working structures are warnings to investigate rather than reasons to report whichever fit is most favorable. With few independent subjects, sandwich standard errors can be downward biased; robust inference is not automatically reliable merely because it is labelled robust.

GEE is useful when the scientific target is a population-average mean count and one wants inference robust to a misspecified within-subject covariance. A fully specified count likelihood can be more efficient if its distribution and dependence assumptions are credible, but incorrect distributional assumptions can affect both estimation and inference. A subject-specific random-effects model targets a different conditional interpretation and is not interchangeable with a marginal GEE. For recurrent-event questions framed around event order or event-time risk sets, PWP and WLW models provide different structures and estimands; the choice should follow the scientific question, not just data format.

A frequent mistake is to read an exchangeable working correlation as evidence that each subject has a fixed common tendency causing their recurrences, or to believe that robust standard errors repair every modeling problem. The correction is to distinguish the components: the mean model defines the target, the working covariance supplies weights, and the sandwich variance addresses covariance misspecification under independent clusters and a correct mean model. It cannot repair a wrong mean, informative missingness, or dependence between subjects.

Key takeaway: A recurrent-count GEE combines a specified marginal mean with a working covariance for repeated measurements within subjects. State the count interval and exposure, interpret coefficients on the marginal mean scale, and base inference on independent subjects rather than on the raw number of intervals.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. In a log-link GEE with an exposure offset, what quantity does \(\exp(X_{ij}^{\top}\beta)\) represent?
  2. Why can a robust sandwich variance be appropriate when the working correlation is wrong, and name one problem it does not fix.
  3. For two intervals with exchangeable correlation \(\alpha=0.25\), what is the off-diagonal element of \(R_i\), and what additional condition must the matrix satisfy?
  4. In the treatment example, why is the analysis based on six clusters rather than twelve independent observations?

Solutions. (1) The modeled marginal mean count per unit exposure. (2) It uses empirical subject-level variability while allowing the working covariance to be approximate; it does not fix a misspecified mean model. (3) The off-diagonal elements are 0.25, and the correlation matrix must be positive definite so it can serve in \(V_i^{-1}\). (4) Each participant contributes two potentially dependent interval counts, so the independent sampling units are the six participants.

Clinical Biostats