MerQuR+Statistics Glossary

Statistics Glossary → Cluster-Robust Cox (Marginal and Frailty Models)

Cluster-Robust Cox (Marginal and Frailty Models)analysis

A method for data with several event times from the same person, family or centre, which estimates Cox regression while allowing for the dependence between these observations, either correcting the standard errors at the cluster level or modelling the differences between clusters with a frailty term.

Concept

Ordinary Cox regression assumes that every event time is independent of the others. Yet the two eyes of one patient, siblings in one family, patients treated in the same hospital or one person's recurrent infections resemble one another: some clusters carry a higher risk across the board for shared, unmeasured reasons. If this dependence is ignored, the estimated standard errors usually come out too small and the effects look more precise than they are.

This analysis offers two approaches. The marginal (cluster-robust) Cox model estimates the coefficients as ordinary Cox does but corrects the standard errors at the cluster level with the sandwich estimator; its hazard ratios are population-averaged (marginal). The shared gamma frailty model gives each cluster a common random effect that multiplies the hazard of all its members by the same factor: h_ij(t) = u_i · h₀(t) · exp(βx_ij). The frailty variance θ shows how large the differences between clusters are; θ = 0 means no dependence. In this model the hazard ratios are conditional: they describe comparisons among members of the same cluster and often take more extreme values than the marginal hazard ratio.

The marginal model makes no assumption about the structure of the dependence, but with few clusters (e.g. fewer than 30-40) the sandwich standard errors become uncertain themselves. The frailty model estimates the differences between clusters explicitly, but relies on the assumption that the frailty follows a gamma distribution. The proportional hazards assumption applies in both models.

When to use it

  • When several event times are observed from the same cluster (person, family, school, hospital, centre) or an event recurs in one person.
  • If the aim is a population-averaged effect with correct standard errors, use the cluster-robust marginal model; if the variation in risk between clusters is itself of interest, or a within-cluster comparison is wanted, the gamma frailty model is preferred.
  • If the data come from a weighted, stratified sampling design, use Survey-PHREG; if covariates change during follow-up, use time-dependent Cox regression (with within-subject robust standard errors).

An everyday example

A dental hospital follows the time to failure of 350 implants placed in 120 patients; most patients have more than one implant. A patient's implants share a similar risk because of common factors (bone structure, oral hygiene, smoking). The cluster-robust model gives the hazard ratio for implant type with standard errors corrected for the patient. The gamma frailty model also estimates θ; a large θ means some patients carry a clearly higher risk across all of their implants.

Parameters in MerQur

Cluster (required)

Concept: The cluster is the identifier grouping observations thought to be dependent on one another. In the marginal model the standard errors are corrected by these clusters; in the frailty model each cluster gets a shared random effect.

Everyday example: In the implant example the cluster is the patient ID: all of a patient's implants belong to the same cluster. The model does not count one patient's three implants as the implants of three independent patients.

What it does: The clusters of the cluster-robust sandwich SE in the marginal model, and the clusters of the shared random effect in the gamma model.

Effect on the result: In the marginal model only SE, t, p and CI (df = C - 1); in the gamma model the coefficient, θ and the cluster frailty estimates.

On the validation data: Since it is a required field there is no separate run; it was used in all runs (kidney: 38 clusters).

→ Cluster-robust (clustered) standard errors

Model (Cluster-robust marginal Cox / + shared gamma frailty)

Concept: The marginal model only corrects the standard errors and gives population-averaged hazard ratios. The shared gamma frailty model explicitly estimates the risk difference between clusters with θ; a significant test of θ = 0 shows within-cluster dependence, and Kendall's τ shows how strongly two event times in the same cluster are related.

Everyday example: The marginal model says 'in an average patient, the failure hazard of a type A implant is 1.5 times that of type B'. The frailty model gives a conditional result such as 'comparing the A and B implants of the same patient, the hazard ratio is 1.9', and θ shows how much risk varies between patients.

What it does: Either only the cluster-robust marginal Cox, or additionally a shared gamma frailty. θ is estimated from the marginal likelihood, β and the frailties by EM (Breslow).

Effect on the result: When gamma is selected, the conditional coefficient table, θ, the likelihood ratio test of θ = 0, Kendall's τ and the cluster frailty table are added; the marginal table does not change.

On the validation data: kidney marginal: age 0.00203188 (SE 0.00819733), sex_male 0.829314 (SE 0.489954). Gamma, rx alone: θ = 1.98025, LR = 9.95773, rx 0.713737 (SE 0.272399). rats: θ = 0.917765, LR = 13.2222.

→ Frailty model

Baseline hazard strata

Concept: The baseline-hazard stratum gives each stratum its own baseline hazard but treats the covariate effects as common across strata. It is used for a variable that violates the proportional hazards assumption or whose effect is not of interest.

Everyday example: If upper- and lower-jaw implants have failure risks that evolve differently over time, jaw position is made a stratum. The hazard ratio for implant type is estimated jointly for both jaws.

What it does: Separate baseline hazard strata in the marginal and gamma models.

Effect on the result: The coefficient and SE change; the stratum effect is not estimated.

On the validation data: kidney, disease stratum: age coefficient 0.00203188 unstratified and 0.00743149 stratified (SE 0.00844918); sex_male 0.829314 and 1.48647 (SE 0.343255).

→ Stratified analysis (stratum variable)

Ties method (Efron / Breslow)

Concept: Sets how the partial likelihood is computed when several events occur at the same time (ties). The Efron approximation is usually more accurate; with few ties it gives almost the same result as Breslow.

Everyday example: If implant failures are recorded only by the month of the check-up, several failures fall in the same month. With few such ties, the difference between the two methods shows only in the third decimal place.

What it does: Ties approximation in the marginal model; gamma frailty always uses Breslow.

Effect on the result: Marginal coefficient and SE; the gamma part is not affected.

On the validation data: kidney Breslow: age 0.00218152 (SE 0.00805087), sex_male 0.820995 (SE 0.488769). Blind Treat_Laser: Efron -0.425026, Breslow -0.424672.

→ Ties method (Efron, Breslow, exact)

Categorical reference (first level / last level)

Concept: For a categorical variable coded as text, makes the alphabetically first or last level the base level. Changing it flips the sign of the coefficient and expresses the hazard ratio for the opposite group; the model itself does not change.

Everyday example: If implant type is coded 'A / B', the first-level reference gives B's hazard ratio relative to A and the last-level reference gives A's relative to B; the two are reciprocals (e.g. 0.67 and 1.5).

What it does: Reference level for a text covariate.

Effect on the result: Parameterisation; the model is the same.

On the validation data: For kidney sex, with the last level as baseline the opposite dummy appears instead of sex_male; Blind: Treat_Others 0.425026 with the first level, Treat_Laser -0.425026 with the last level.

→ Reference category (comparison level)

Additional output: Save residuals to the dataset

Concept: Adds the marginal model's martingale, deviance and dfbeta residuals for each observation to the data set. Dfbeta shows how much the coefficients change when an observation is removed and helps find influential observations.

Everyday example: If one patient's implants have very large dfbeta values, the implant-type effect may rest largely on that single patient. The analysis is rerun without this patient to see how much the result changes.

What it does: Adds the martingale, deviance and dfbeta residuals of the marginal model to the dataset.

Effect on the result: Does not change the result tables.

On the validation data: The tables remain the same; 304 new values are added.

→ Cox model residuals (martingale, deviance, Cox-Snell, dfbeta)

Confidence Level (%90 / %95 / %99 / Other, custom value)

Concept: Sets the level of the confidence interval for the hazard ratios. In the marginal model the interval is built from a t distribution with degrees of freedom based on the number of clusters, so with few clusters it widens noticeably.

Everyday example: Even with 350 implants there are only 120 patients (clusters), so the uncertainty is judged by the number of patients. Had the study included only 25 patients, the 95% interval for the implant-type hazard ratio would be much wider.

What it does: The marginal HR interval uses the t(C-1) quantile, the gamma HR interval the z quantile.

Effect on the result: Only the interval limits.

On the validation data: In the %90, %99, %97.5 and %80 runs only the interval limits change.

→ Confidence level and confidence interval

Example on real data

Data: Kidney catheter infection (McGilchrist and Aisbett 1991), R survival kidney

Variables: time time (days), event status, cluster id (patient), predictors age and sex_k

  • Question: In kidney dialysis catheter infections (38 patients, 2 infection times per patient; 76 observations, 58 events), do age and sex affect the hazard of infection?
  • Why cluster-robust: The two times of the same patient are not independent; the marginal Cox estimates the coefficients in the usual way and corrects the SE with a patient (cluster) level sandwich estimator (C/(C-1)-corrected, t(37)).
  • Result: The male sex coefficient is 0.8293 (SE 0.4900, p = 0.0989), HR = 2.29 [0.849, 6.185]; age 0.0020 (SE 0.0082, p = 0.806). No predictor is significant at the 5% level.
  • Overall test: Global Wald χ²(2) = 2.91, p = 0.233; Wald F(2, 37) = 1.45, p = 0.247.
  • Limitation: The marginal model does not model between-cluster heterogeneity (frailty); the shared gamma frailty option gives conditional coefficients and θ. With few clusters (38) the SE estimate is uncertain.
  • APA: In the cluster-robust Cox model, male sex, HR = 2.29, 95% CI [0.85, 6.18], p = .099, and age, HR = 1.00, p = .806, were not significantly associated with the hazard of infection.

Related concepts

Ties method (Efron, Breslow, exact)Frailty modelCluster-robust (clustered) standard errorsCox model residuals (martingale, deviance, Cox-Snell, dfbeta)GEE working correlation and marginal modelsKendall's tauStratified analysis (stratum variable)Reference category (comparison level)

The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.