Tutorials › Competing Risks and Multi-State Models › Robust Variance In Marginal Rate Models

Recurrent-Event Estimands and Models · Tutorial 594 of 699

Robust Variance In Marginal Rate Models

Learn how to build and interpret sandwich variance estimates from independent subjects’ contributions when recurrent events within a subject may be dependent.

Advanced 13 min read

What You'll Learn

  • Distinguish the marginal rate model from assumptions about dependence among a subject’s recurrent events.
  • Construct the sandwich variance from subject-level estimating-equation contributions.
  • Interpret the bread, meat, and resulting standard errors on the log-rate and rate-ratio scales.
  • Compare robust variance estimates with model-based variance estimates.
  • Recognize when a small number of subjects or an influential subject makes robust inference unreliable.

Why the Variance Must Respect the Subject

A marginal rate model describes how covariates relate to a subject’s recurrent-event rate. Its regression coefficient may be estimated from event times, but the independent sampling units are usually the subjects, not the individual events. Events from the same subject can be associated: an earlier event may predict a later one, or subjects may differ in unmeasured susceptibility. Treating every event as an independent observation can therefore give a misleading standard error, even when the estimated rate effect is useful.

The sandwich variance addresses this issue by first calculating each subject’s contribution to the estimating equation and then measuring the variability of those contributions across subjects. It does not require independent events within a subject. It does require independent subjects and a correctly specified marginal estimating equation, along with regularity conditions described below.

Definition: Suppose an estimator \(\hat{\beta}\) solves \(\sum_{i=1}^{m}\psi_i(\beta)=0\), where \(i\) indexes \(m\) independent subjects and \(\psi_i(\beta)\) is subject \(i\)’s contribution to the estimating equation. Define the bread \(A=-\sum_i \partial\psi_i(\beta)/\partial\beta^\mathsf{T}\) and the meat \(B=\sum_i\psi_i(\beta)\psi_i(\beta)^\mathsf{T}\), evaluated at \(\hat{\beta}\). The subject-level sandwich variance estimate is \(A^{-1}BA^{-\mathsf{T}}\). Here \(A^{-\mathsf{T}}\) denotes the transpose of \(A^{-1}\).

For a proportional marginal rate model, a common form is \(\lambda_i(t)=\lambda_0(t)\exp\{\beta^\mathsf{T}Z_i(t)\}\), where \(\lambda_i(t)\) is the modeled marginal event rate for subject \(i\), \(\lambda_0(t)\) is an unspecified baseline rate, and \(Z_i(t)\) is a covariate vector. A rate ratio for a one-unit increase in covariate \(Z_j\) is \(\exp(\beta_j)\), holding the other modeled covariates fixed. The model specifies the marginal rate relationship; it does not assert that a subject’s event process has independent increments.

The LWYY marginal rate model uses an estimating equation based on the observed recurrent events and risk sets. In a partial-likelihood representation, define \(S^{(0)}(\beta,t)=\sum_iY_i(t)\exp\{\beta^\mathsf{T}Z_i(t)\}\), \(S^{(1)}(\beta,t)=\sum_iY_i(t)\exp\{\beta^\mathsf{T}Z_i(t)\}Z_i(t)\), and \(\bar Z(\beta,t)=S^{(1)}(\beta,t)/S^{(0)}(\beta,t)\). Here \(Y_i(t)\) indicates whether subject \(i\) is under observation and at risk, and \(N_i(t)\) counts that subject’s events. The score has the form \(\sum_i\int [Z_i(t)-\bar Z(\beta,t)]\,dN_i(t)=0\). Subject-level sandwich contributions must be formed in a way that accounts for estimating the shared risk-set quantities and baseline rate; they are not obtained by pretending each event is a separate subject.

Constructing and Interpreting the Sandwich

The bread describes how sharply the total estimating equation changes as \(\beta\) changes. The meat describes the observed variability of the independent subjects’ contributions. Combining them gives the variability of the estimator. In a scalar model, this reduces to \(B/A^2\). For a vector of coefficients, the matrix calculation retains covariance between coefficient estimates.

A useful justification follows by expanding the estimating equation around the true parameter \(\beta_0\). If the estimator is consistent and the score is sufficiently smooth, then, to first order,

$$ 0 \approx \sum_{i=1}^{m}\psi_i(\beta_0)-A(\hat{\beta}-\beta_0), \qquad \hat{\beta}-\beta_0 \approx A^{-1}\sum_{i=1}^{m}\psi_i(\beta_0). $$

The independent units in the sum are subjects. The variance of a sum of independent, mean-zero subject contributions is the sum of their covariance matrices, estimated by \(B=\sum_i\psi_i\psi_i^\mathsf{T}\). Substituting that estimate into the linear approximation gives \(A^{-1}BA^{-\mathsf{T}}\). Dependence among events within one subject affects that subject’s contribution and its variability; it does not invalidate the across-subject sum when subjects are independent.

This argument is asymptotic. It relies on a sufficiently large number of independent subjects, finite contribution variances, a nonsingular bread, and appropriate regularity and censoring conditions. For the rate model, the marginal rate structure must be correctly specified for the intended coefficient interpretation. Follow-up and censoring must not create informative loss of observation that is ignored by the estimating equation. If nuisance quantities such as the baseline rate are estimated, their effect must be handled in the subject-level influence contributions or equivalent sandwich calculation.

Worked Example: One Group and a Subject With Many Events

Suppose five independent subjects each contribute one unit of observation time. Their hypothetical event counts are \(0,0,0,0,5\). Fit an intercept-only log-rate model, so the estimated rate is total events divided by total exposure. This example uses a simple subject-level estimating equation to show how clustering enters the variance; it is not a full treatment of count-based GEE models.

The estimated rate is \(5/5=1\) event per subject-time unit, so \(\hat{\beta}=\log(1)=0\). Each subject’s fitted mean count is \(\hat{\mu}_i=1\), and the score contribution for the log rate is \(\psi_i=N_i-\hat{\mu}_i\). The five contributions are \(-1,-1,-1,-1,4\). The bread is \(A=\sum_i\hat{\mu}_i=5\), and the meat is

$$ B=\sum_i\psi_i^2=1+1+1+1+16=20, \qquad \widehat{\operatorname{Var}}(\hat{\beta})=\frac{20}{5^2}=0.8000. $$

Thus the robust standard error of the log rate is \(\sqrt{0.8000}=0.8944\). Under a working model that treats the counts as independent Poisson observations, the model-based variance would be \(1/A=0.2000\), with standard error \(0.4472\). In these hypothetical data, one subject supplies all five events, so the observed between-subject variability in score contributions is much larger than the working Poisson calculation suggests. The robust calculation does not prove that the subjects have a particular dependence mechanism; it shows that the independent-subject contributions are unusually variable in this sample.

Worked Example: Sandwich Variance for a Rate Ratio

Consider four hypothetical subjects with one unit of follow-up each: two unexposed subjects have counts \(0\) and \(2\), and two exposed subjects have counts \(1\) and \(3\). Fit a log-rate model with an intercept and a binary exposure indicator \(x_i\). The group rates are \(1\) and \(2\) events per subject-time unit, so \(\hat{\beta}_0=\log(1)=0\) and \(\hat{\beta}_1=\log(2)=0.6931\). The estimated rate ratio is \(\exp(\hat{\beta}_1)=2.000\).

For this estimating equation, each subject contributes \(\psi_i=X_i(N_i-\hat{\mu}_i)\), where \(X_i=(1,x_i)^\mathsf{T}\), and \(\hat{\mu}_i=\exp(\hat{\beta}_0+\hat{\beta}_1x_i)\). The fitted means are \(1\) for each unexposed subject and \(2\) for each exposed subject. The score contributions are therefore \((-1,0)^\mathsf{T},(1,0)^\mathsf{T},(-1,-1)^\mathsf{T},(1,1)^\mathsf{T}\). The bread and meat are

$$ A=\sum_i\hat{\mu}_iX_iX_i^\mathsf{T} =\begin{pmatrix}6&4\\4&4\end{pmatrix}, \qquad B=\sum_i\psi_i\psi_i^\mathsf{T} =\begin{pmatrix}4&2\\2&2\end{pmatrix}. $$

Since \(A^{-1}=\begin{pmatrix}0.5&-0.5\\-0.5&0.75\end{pmatrix}\), the sandwich variance matrix is \(A^{-1}BA^{-\mathsf{T}}\). Its exposure-coefficient variance is \(0.6250\), giving \(SE(\hat{\beta}_1)=\sqrt{0.6250}=0.7906\). A Wald 95% interval on the log-rate-ratio scale is \(0.6931\pm1.96(0.7906)=(-0.8564,2.2427)\). Exponentiating the rounded log-scale endpoints gives an approximate 95% confidence interval of \((0.425,9.42)\) for the rate ratio. In repeated sampling under the stated assumptions, the procedure is designed to cover the true rate ratio about 95% of the time; this interval is wide and does not establish a precise effect. With only four independent subjects, the large-sample approximation is particularly uncertain.

Worked Example: Unequal Observation Times

Suppose three independent hypothetical subjects have observation times \(T_i=(1,2,1)\) time units and event counts \(N_i=(0,2,2)\). Fit an intercept-only log-rate model with mean \(\mu_i=T_i\exp(\beta)\). The estimated rate is \(4\) events divided by \(4\) time units, or \(1\) event per time unit, so \(\hat{\beta}=0\) and the fitted means are \((1,2,1)\).

The score contributions are \(N_i-\hat{\mu}_i=(-1,0,1)\). The bread is \(A=\sum_i\hat{\mu}_i=1+2+1=4\), and the meat is \(B=(-1)^2+0^2+1^2=2\). Hence the robust variance for the log rate is \(2/4^2=0.1250\), and its standard error is \(\sqrt{0.1250}=0.3536\). The independent-Poisson model-based variance is \(1/A=0.2500\), with standard error \(0.5000\). These estimates differ because the sandwich uses the observed subject-level residuals, not only the fitted Poisson information. Three subjects are far too few for this comparison to support reliable large-sample inference.

Assumptions, Diagnostics, and Alternatives

The sandwich is robust to misspecification of the within-subject event dependence structure, not to every modeling error. In particular, it does not repair a wrong marginal rate form, omitted covariates that change the target relationship, informative censoring handled as if it were independent, or dependence between subjects that is ignored. The independent cluster must be defined correctly: if subjects share a household, clinic, or other source of dependence, that higher-level unit may need to be the cluster.

Check the analysis by examining the number of independent subjects, the distribution of event counts and follow-up, and the subject-level score or influence contributions. A small number of subjects, highly unequal follow-up, or one subject with an unusually large contribution can make the sandwich unstable. Also check that estimated bread matrices are nonsingular and that the model’s fitted rates are compatible with the observed covariate and follow-up patterns. A robust standard error that differs greatly from the model-based one is a reason to investigate, not proof that one calculation is automatically correct.

The model-based variance is typically more efficient when its full working assumptions, such as the relevant Poisson variance structure and event-level independence, hold. The sandwich relaxes those dependence assumptions but relies on many independent clusters for its approximation. A subject-level bootstrap is another possible approach: resample whole subjects, retaining all their events and follow-up together, and refit the model in each sample. Resampling individual events would break the within-subject structure and is generally inappropriate. Neither sandwich inference nor a cluster bootstrap can manufacture information when only a few independent subjects are observed. Small-sample corrections may help in some settings, but their validity depends on the estimator and design.

Common Mistake

Wrong reasoning: “There are hundreds of recurrent events, so the variance estimate has a very large effective sample size; I can use the ordinary independent-event standard error.” This counts correlated events as if they were independent sampling units.

Correction: Form the variability estimate from subject-level contributions, keeping each subject’s events together. The number of independent subjects, not simply the total event count, governs the main large-sample justification. Conversely, the sandwich is not guaranteed to be larger than the model-based variance: as the unequal-exposure example shows, the empirical cluster variability can yield a smaller estimate.

Key takeaway: In a marginal recurrent-event rate model, the sandwich variance is \(A^{-1}BA^{-\mathsf{T}}\), with the meat built from independent subjects’ estimating-equation contributions. It allows within-subject dependence to affect uncertainty while preserving the specified marginal rate estimand, but it remains an asymptotic method and does not protect against a misspecified mean model or too few independent subjects.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. In a sandwich variance calculation, what sampling units should contribute to the meat when recurrent events are clustered within subjects?
  2. In an intercept-only rate model, four subjects each contribute one unit of exposure and have counts \(1,1,1,1\). Calculate the log-rate estimate, bread, meat, and robust variance.
  3. Does a subject-level sandwich require events within a subject to be independent? Name two assumptions it still needs.
  4. Why is resampling individual events generally unsuitable for a subject-level bootstrap?
  5. What does it imply if one subject contributes an unusually large amount to the meat?

Solutions. (1) Use the subject-level contributions, one vector per independent subject. (2) The rate estimate is \(4/4=1\), so \(\hat{\beta}=0\). Each fitted mean is \(1\), giving \(A=4\); all four score residuals are zero, so \(B=0\) and the plug-in sandwich variance is \(0\). This degenerate sample does not show that the population rate is known without uncertainty; it illustrates that a raw empirical meat can be unstable with very few clusters. (3) No. It still needs independent subjects, a correctly specified marginal estimating equation, and suitable regularity and censoring conditions. (4) It separates events that belong to the same subject and thereby destroys the observed within-subject structure; resample whole subjects instead. (5) The variance estimate may be strongly influenced by that subject, so investigate data quality, model fit, and sensitivity, and be cautious if the number of subjects is small.

Clinical Biostats