Written and maintained by CASRAI Editorial Board
Last updated
A frailty model adds a random-effect term to a survival model — an unobserved, multiplicative factor that raises or lowers a subject’s or a cluster’s hazard relative to its covariates — to account for the fact that event times sharing a cluster (patients within a hospital, litters within a dam, recurrent events within a person) are correlated, not independent. Standard Cox regression assumes each event time contributes an independent piece of information to the partial likelihood. Whenever your outcomes come in groups whose members tend to fail together or apart because of unmeasured shared risk — the same surgeon, the same genetic background, the same person contributing several recurrent events — that assumption is false, and a frailty term is the survival-analysis-specific fix for it. This guide covers what the frailty term represents, how to choose between shared and individual frailty, which distribution to pick and why it rarely matters much for the fixed effects, how to estimate one, and what a frailty model still cannot do for you. For the model it extends, see the Cox proportional hazards model; for the data-type-general version of this same idea, see mixed-effects models.
The Problem: Cox Regression Assumes Independent Event Times
The Cox partial likelihood is built one risk set at a time, comparing the covariates of whoever failed against everyone still at risk. That construction is only valid if each subject’s failure time carries information independent of every other subject’s. Two common study designs violate this outright:
- Clustered subjects. Patients nested within hospitals, siblings within families, animals within litters. Members of the same cluster typically share something the model does not measure — surgeon skill, local practice patterns, genetic background, environment — so their event times are correlated even after adjusting for the covariates you did collect.
- Recurrent events within the same subject. A patient who is readmitted three times, a device that fails and is repaired repeatedly, an animal with multiple tumor occurrences. Each subject contributes more than one event time, and those event times are obviously not independent of each other — they came from the same person.
Fitting an ordinary Cox model on data like this without adjustment does not bias the coefficient estimates much on average, but it understates their standard errors — the model is effectively pretending you have more independent information than you do, because it is treating correlated observations as if each one taught it something new. The result is confidence intervals that are too narrow and p-values that are too small. This is the specific gap already flagged, in passing, on this site’s Cox proportional hazards guide, which notes that clustered or recurrent survival data “need a frailty term or clustered/robust standard errors” without walking through what that frailty term actually is — that is what this guide does.
What a Frailty Term Actually Is
A frailty is an unobserved, multiplicative random effect on the hazard function. For a shared frailty model, the hazard for subject j in cluster i is written:
hij(t) = zi · h0(t) · exp(xij′β)
where h0(t) is the baseline hazard, xij′β is the usual linear predictor from measured covariates, and zi is the frailty: a positive random variable, one value per cluster, that scales the whole hazard up or down. A cluster with zi > 1 is “frailer” — at higher risk than its covariates alone predict, presumably because of something unmeasured that its members share. By convention zi is scaled to have mean 1, so it perturbs relative risk around the baseline rather than shifting it in one direction. The variance of that distribution, usually called θ, is the actual quantity of interest for understanding the clustering itself: it measures how much unmeasured heterogeneity exists between clusters, on top of whatever the measured covariates already explain. A θ near zero means the covariates account for essentially all the between-cluster variation and clustering can be safely ignored; a large θ means there is substantial shared risk your model isn’t capturing, and it is inducing real correlation among the event times within a cluster.
Shared Frailty vs. Individual Frailty
The term “frailty model” covers two structurally different uses of the same idea:
- Shared frailty models assign one frailty value per cluster, applied to every member of that cluster. This is the multi-subject, multi-cluster case above — it is a random effect in the same sense a random intercept is in a mixed-effects model, and it is directly estimable because you observe multiple event times per frailty value.
- Individual (univariate) frailty models assign an unshared frailty to every single subject, with no clustering at all. These are used to explain population-level phenomena that a fixed-hazard model cannot: for instance, an apparent slowing or reversal of a hazard ratio at long follow-up is frequently a selection artifact rather than a real change in individual risk — the frailest members of a group fail earliest, so the survivors remaining at later time points are, on average, a systematically hardier subset than the group started with. A univariate frailty model formalizes that selection process. Because there is only one observation per frailty value, θ is not identifiable from the data alone in this setting without extra structure (repeated measures, known covariate effects, or external information) — it is a modeling device for explaining aggregate hazard behavior, not something you fit and report a confidence interval for the way you would with shared frailty.
This guide is primarily about the shared-frailty case, since that is what “clustered survival data” refers to and what is actually estimable from a typical dataset.
Choosing a Frailty Distribution
θ and zi need a distributional family before the model can be fit. The choice affects computational convenience and how θ is interpreted, but has relatively little effect on the estimated fixed-effect coefficients (β) themselves — the literature on frailty models consistently finds the covariate effects are fairly robust to misspecifying the frailty distribution, even though the frailty variance’s numerical value and its exact interpretation are not.
- Gamma is the default in almost every implementation. It has a closed-form marginal likelihood after integrating out
zi(no numerical integration required), which is why it dominates in practice. Its variance parameter θ has a direct interpretation as a Kendall’s-tau-type dependence measure between within-cluster event times, shown numerically below. - Log-normal is the frailty distribution used by mixed-model-style software (R’s
coxme), because it generalizes cleanly to nested and crossed random-effects structures the way linear mixed models do — multiple random effects, random slopes, and so on. It has no closed-form marginal likelihood and needs Laplace approximation or numerical integration, but it is the natural choice once your clustering structure is more complex than one flat grouping variable. - Positive stable distributions have the mathematical property that the frailty distribution among survivors at any later time remains in the same family as the one you started with — useful in some theoretical and competing-risks contexts, uncommon in applied practice.
- Inverse Gaussian is an occasional alternative to gamma with a heavier tail; it shows up in some applied and theoretical papers but is far less commonly implemented than gamma or log-normal.
Foundational references for the frailty concept itself: Vaupel, Manton & Stallard introduced individual frailty to explain population mortality dynamics (Demography, 1979); Clayton formalized the shared-frailty structure for bivariate and clustered failure-time data as a model of familial association in chronic disease (Biometrika, 1978) — the same association structure is now more commonly called the Clayton copula outside the survival-analysis literature specifically.
What the Frailty Variance Actually Means: A Reproducible Simulation
θ is easiest to understand through the correlation it induces, not through its raw numeric value. For a shared gamma frailty (mean 1, variance θ) applied to two members of the same cluster, the pairwise Kendall’s tau between their event times has a closed form:
τ = θ / (θ + 2)
| Frailty variance (θ) | Kendall’s tau between within-cluster event times |
|---|---|
| 0.25 | 0.111 |
| 0.50 | 0.200 |
| 1.00 | 0.333 |
| 1.50 | 0.429 |
| 2.00 | 0.500 |
| 4.00 | 0.667 |
To confirm that relationship rather than just quote it, this was checked with an independent, seeded simulation (not from a real study — a self-generated numerical check, reproducible by rerunning the same code): 200,000 cluster pairs were simulated with a gamma frailty of θ = 1.5 (shape 1/θ, scale θ, so mean 1 and variance 1.5 by construction — confirmed by the simulation’s own sample mean of 1.0002 and sample variance of 1.4952 against those targets), each pair drawing two exponential event times conditional on its shared frailty draw. Kendall’s tau, computed on a 3,000-pair subsample by direct concordant/discordant pair counting (3,210,372 concordant vs. 1,288,112 discordant pairs), came out to 0.4273 against a theoretical value of 0.4286 — a close match, which is what you’d expect from finite-sample Monte Carlo noise around the closed-form relationship. Practically: a θ around 1.5 corresponds to a moderate-to-strong within-cluster dependence (τ ≈ 0.43) — clusters are not just administratively grouped, they are meaningfully more similar to each other in event timing than two random subjects would be, and treating them as independent would materially understate your standard errors.
Estimation: How θ and β Actually Get Fit
Three estimation strategies are in general use, and which one a given piece of software implements determines what you’re actually getting:
- EM algorithm. Treats the unobserved frailties as missing data: given current estimates of β and θ, compute the expected frailty for each cluster (E-step), then re-estimate β and θ treating those expectations as known (M-step), iterating to convergence. Conceptually clean, historically important, computationally slower than the alternatives below for large numbers of clusters.
- Penalized partial likelihood (PPL). Treats the log-frailties as random effects entering the Cox partial likelihood with a ridge-like penalty term whose penalty weight is tied to θ, and profiles over θ via an approximate restricted likelihood. This is the approach behind R’s older
coxph(..., frailty())syntax and is fast, but is now considered a semi-approximate method relative to full marginal likelihood. - Full (marginal) likelihood via Laplace approximation. Integrates the frailties out of the likelihood analytically (gamma) or via Laplace/numerical approximation (log-normal and other distributions without a closed form), giving proper maximum-likelihood-based standard errors and model comparison via likelihood ratio tests. This is the approach behind
coxme,frailtypack, and most modern implementations, and is the generally preferred method where available.
Software for Fitting Frailty Models
- R:
survival::coxph()with afrailty()term (the older PPL approach);coxme(log-normal random effects, mixed-model-style formula syntax, handles nested/crossed structures);frailtypack(gamma and log-normal shared frailty, plus nested, joint, and recurrent-event frailty models — the most feature-complete option for non-standard clustering);parfm(parametric, rather than semi-parametric, frailty models for several baseline-hazard and frailty-distribution combinations). - Stata:
stcox, shared()fits a shared gamma (or inverse-Gaussian) frailty Cox model directly;streg, frailty()does the same for fully parametric survival models. - SAS:
PROC PHREGwith aRANDOMstatement fits gamma or log-normal shared frailty models.
Frailty Models vs. the “Robust Standard Errors” Alternative — the GEE-vs-Mixed-Effects Choice, for Survival Data
Clustered or recurrent-event survival data can also be handled without modeling the dependence at all: fit an ordinary Cox model, then correct the standard errors for clustering using a robust (sandwich) variance estimator with the cluster as the grouping variable — the approach formalized by Lin & Wei for the Cox model (Journal of the American Statistical Association, 1989), and closely related to the Lee-Wei-Amato marginal approach for multivariate failure times. This is the direct survival-analysis analog of the choice between GEE and mixed-effects models for longitudinal or clustered data generally, already covered on this site for the non-survival case:
- The robust-sandwich-variance approach is the GEE-style choice: it estimates population-averaged effects, treats the within-cluster correlation as a nuisance to correct for rather than a quantity to estimate, requires no assumption about the frailty distribution, and is simpler to specify. It does not, however, tell you anything about how strong the clustering actually is — there is no θ to interpret.
- The frailty model is the mixed-effects-style choice: it estimates a subject/cluster-specific effect via an explicit random-effects distribution, and in doing so gives you θ itself as a substantive, interpretable quantity — how much unmeasured heterogeneity exists between clusters, and (via Kendall’s tau) how strongly correlated within-cluster event times actually are. The cost is a distributional assumption about the frailty and more complex estimation.
If the clustering itself is not something you care about characterizing — you just need correct standard errors on your treatment effect — the robust-variance approach is simpler and sufficient. If part of the research question is how much unmeasured shared risk exists within clusters (or you need person-specific rather than population-averaged predictions for recurrent-event data), a frailty model is the right tool, the same way a mixed-effects model is the right tool over GEE when the random-effects structure itself is substantively interesting. See mixed-effects models: choosing random vs. fixed effects for the non-survival version of this same decision, and the intraclass correlation coefficient and cluster-randomized trials and the design effect for how the same within-cluster-correlation idea is quantified outside survival analysis.
What a Frailty Model Does Not Fix
- Unmeasured cluster-level confounding. A frailty term absorbs unexplained heterogeneity into a random effect; it does not turn that heterogeneity into something you understand, and it does not protect against a cluster-level variable that is both correlated with your covariates and with the outcome. If hospital-level frailty is partly driven by a confounder like average patient severity, and that confounder also correlates with treatment assignment across hospitals, the frailty term does not resolve that confounding — it just correctly acknowledges that the correlation exists.
- Identifiability with too little within-cluster information. Shared frailty needs multiple events (or, in some formulations, multiple observed subjects) per cluster to separate the frailty variance from ordinary sampling noise. A design with exactly one event per cluster and no repeated structure generally cannot identify θ from a shared frailty model without extra assumptions — this is exactly the univariate-frailty caveat above.
- Getting the fixed effects “more correct” by picking a better distribution. As noted above, β is fairly robust to which frailty distribution you choose; spending analytical effort agonizing over gamma vs. log-normal for the sake of the treatment effect estimate is usually not where the payoff is. Where the distribution choice matters most is θ’s own numerical value and interpretability, and in whether your software can handle the clustering structure you actually have (nested, crossed, recurrent) at all.
Frequently Asked Questions
What is a frailty model in survival analysis?
A frailty model is a survival model — typically an extension of the Cox proportional hazards model — that includes a random-effect term, the “frailty,” representing unobserved risk shared within a cluster or unobserved heterogeneity between individuals. It exists specifically to handle event-time data that violate the independence assumption ordinary Cox regression relies on.
What is the difference between a shared frailty model and a mixed-effects model?
They are the same underlying idea applied to different outcome types. A shared frailty model puts a random effect on the hazard scale for time-to-event data; a mixed-effects (random-intercept) model puts a random effect on the linear predictor scale for continuous, binary, or count outcomes. Both let a grouping variable’s effect be modeled as drawn from a distribution rather than estimated as a fixed, separate parameter per group.
Should I use gamma or log-normal frailty?
Gamma is the standard default — it has a closed-form marginal likelihood, is fast to fit, and gives θ a direct Kendall’s-tau interpretation. Log-normal is the better choice once your clustering structure is more than a single flat grouping variable (nested, crossed, or multiple random effects), because it generalizes the way mixed-model random effects do. In practice, the fixed-effect estimates rarely differ much between the two; the choice mainly affects θ’s interpretation and what clustering structures your software can handle.
How do I interpret the frailty variance, θ?
θ is the variance of the frailty distribution (mean fixed at 1). A θ near zero means little unexplained clustering remains after your covariates. Larger θ means more unmeasured within-cluster shared risk. For gamma frailty specifically, θ converts directly to a Kendall’s tau dependence measure via τ = θ/(θ+2) — for example, θ = 1.5 corresponds to τ ≈ 0.43, a moderate-to-strong within-cluster correlation in event timing.
Can I fit a frailty model in R?
Yes. coxph() in the survival package supports a frailty() term; coxme fits log-normal random-effects Cox models with mixed-model-style syntax; frailtypack handles gamma and log-normal shared, nested, joint, and recurrent-event frailty models and is the most complete option for non-standard clustering structures.
Does a frailty model replace the need for robust standard errors?
They are two different solutions to the same problem, not the same solution twice. A frailty model explicitly estimates the within-cluster dependence structure (giving you θ); a robust sandwich-variance correction on an ordinary Cox model instead just corrects the standard errors for clustering without modeling why it exists. Use robust variance when you only need valid inference on your fixed effects; use a frailty model when the clustering itself, or subject-specific (rather than population-averaged) prediction, is part of the question.








