How this calculation works
Compare exact areas under two Kaplan–Meier survival curves through a common supported horizon. Report an absolute restricted mean survival difference and Greenwood tail-area uncertainty.
RMST(τ)=∫₀^τ Ŝ(t)dt; Δ=RMST₁−RMST₂; Var(Δ)=Var₁+Var₂.A worked example
Through time 5, the first RMST is 3.708333, the second is 4.166667, and their difference is -0.458333.
Good to know
3–300 independent subjects per group; positive times, binary status; common positive horizon no later than either maximum follow-up. Exact KM integration and asymptotic Greenwood/normal difference interval. No paired-group covariance, covariate adjustment or competing-risk estimand.
Reference: R survival restricted mean and covariance implementation (opens in a new tab) ↗
Choose a common time horizon
Restricted mean survival time is the area under a survival curve from zero to a chosen horizon. It measures expected event-free time accumulated within that window. Restricting the window avoids pretending that incomplete follow-up identifies the entire tail or the unrestricted mean event time.
The comparison uses the same horizon for both independent groups and reports first group minus second group. A positive result means more estimated event-free time in the first group during that window. The sign is meaningful only when the time origin, event definition and units agree between the two samples.
Compare this with the Log rank survival comparison calculator with censoring. Integrate two censoring-aware survival curves to an entered horizon and report the difference in expected event-free time.
Represent events and censoring separately
Each group has its own positive time list and matching binary status list. Status one means the event occurred, while zero means observation ended before an event was observed. Subjects remain in the risk set until their recorded time, so censoring affects the survival estimate without becoming an event.
At a shared recorded time, event counts use the full pre-event risk set before censor removals. Keep that convention when checking another implementation. There is no requirement that the groups contain the same number of subjects, but their records must represent independent subjects rather than repeated measurements of the same people.
Integrate the steps exactly
The Kaplan–Meier curve starts at one and decreases only at observed event times. The implementation multiplies each constant survival level by the length of its interval, then adds those rectangular areas through the horizon. Numerical quadrature or arbitrary plotting grids are unnecessary for this step function.
An event exactly at the horizon changes survival at a single endpoint and contributes no additional area beyond it. Censoring times can change later risk-set denominators even though they do not directly lower survival. Those distinctions matter when hand-checking a small example containing both events and censoring.
Work through the six-subject examples
The first prefilled group has events at times one, three, four and six, with censoring at two and five. Up to horizon five, the successive survival levels contribute a total restricted mean of approximately 3.708333. The last event at six lies outside the requested window.
The second group starts its events later and has estimated restricted mean approximately 4.166667 through the same horizon. Subtracting gives about minus 0.458333 time units. This is an absolute difference in accumulated event-free time, so it does not need to be converted from a hazard ratio or an odds ratio.
Uncertainty depends on shared survival steps
Survival estimates at successive times are correlated because they use overlapping observations. The variance here uses Greenwood event terms multiplied by squared remaining survival areas. Summing independent pointwise survival errors would ignore that covariance and give the wrong restricted-mean uncertainty.
The two group variances are added because the groups are assumed independent. Their square root is the standard error of the difference. A conventional normal interval uses this standard error and the normal 1.96 multiplier; it is an asymptotic approximation and can perform poorly for very small or heavily censored samples.
Respect the supported follow-up
The requested horizon cannot exceed either group’s last observed follow-up. This rule prevents the calculator from extending a surviving final plateau into an unsupported future period. A scientifically chosen earlier horizon is often more stable than selecting the furthest possible time after inspecting the observed difference.
Reaching the last follow-up still does not guarantee precise tail estimation. If only a few subjects remain at risk near the horizon, their observations can dominate uncertainty. Compare the event timeline and study follow-up pattern rather than treating a numerically valid area as proof of reliable long-term estimation.
Interpret the contrast at its stated horizon
A different horizon defines a different estimand. Two survival curves can cross, so a positive early difference can shrink or reverse over a longer interval. Report the horizon and units with every restricted-mean difference rather than quoting the difference without its window.
This page does not adjust for covariates, handle competing events as separate states, model informative censoring or analyze matched groups. Independent censoring within each group remains an assumption. For applied conclusions, choose the horizon using substantive considerations and examine whether censoring and enrollment patterns support that comparison.
A few questions, answered
Does the horizon change the question?
Yes. Each horizon defines a different accumulated event-free-time estimand.
What is the sign convention?
The difference is first-group RMST minus second-group RMST.
Can I use a horizon beyond follow-up?
No. The implementation rejects a horizon beyond either group’s maximum recorded time.
Is the interval exact for small samples?
No. It uses asymptotic Greenwood variance and a normal multiplier.