Signature
S_2 = S_1 * (1 - (w_1 * d_1 + w_2 * d_2) / (w_1 * n_1 + w_2 * n_2))
| Inputs | Definition | Unit |
|---|---|---|
S_1 | Kaplan-Meier survival at the start of the interval | probability |
w_1 | Weight of uncensored patients in group 1, such as progressed non-switchers | none |
d_1 | Deaths in the interval among uncensored patients in group 1 | count |
w_2 | Weight of uncensored patients in group 2, such as progression-free patients | none |
d_2 | Deaths in the interval among uncensored patients in group 2 | count |
n_1 | Patients in group 1 at risk at the start of the interval and not censored | count |
n_2 | Patients in group 2 at risk at the start of the interval | count |
S_2 | Estimated probability of surviving the interval, carried from S_1 | probability |
|---|
Function
Inverse probability of censoring weighting for dependent censoring
Maps patients who remain under observation to weights equal to the inverse of their probability of having remained uncensored, given their covariate history, so that they also represent similar patients who were censored. Weighted versions of the Kaplan-Meier estimator, the Cox model and mean cost estimators then remove the bias that dependent censoring causes, provided every factor predicting both censoring and outcome is measured. The notation follows the Dependent Censoring article and its switchers-censored control arm.
Try this function
Implementations
Excel
IPCW-weighted survival step from named counts and weights
With SurvPrev, WeightOne, DeathsOne, AtRiskOne, WeightTwo, DeathsTwo and AtRiskTwo named, the formula returns survival at the end of the interval, held in WeightedSurv. For many patients, =SurvPrev*(1-SUMPRODUCT(Weights,Deaths)/SUMPRODUCT(Weights,AtRisk)) uses one row per patient.
=SurvPrev*(1-(WeightOne*DeathsOne+WeightTwo*DeathsTwo)/(WeightOne*AtRiskOne+WeightTwo*AtRiskTwo))
Assumptions
Dependent censoring explained by the measured prognostic groups
Within each group, censored and uncensored patients have the same hazard, so the weighted risk set represents everyone event free; in the article switching depends only on progression.
Switchers censored before deaths in the IPCW-weighted interval
Switchers are censored at the start of the interval, before any deaths in it, and the weights apply to the patients still at risk.
Worked examples
Year-2 survival with switchers censored and reweighted
With weights of 2 for the 30 progressed non-switchers (12 deaths) and 1 for the 90 progression-free patients (9 deaths), the weighted deaths are 33 in a weighted risk set of 150, so survival is 0.75 times 0.78, or 0.585, the no-switching value, as in the article.
S_1 = 0.75; w_1 = 2; d_1 = 12; n_1 = 30; w_2 = 1; d_2 = 9; n_2 = 90; S_2 = 0.585
Year-2 survival with switchers simply censored
With both weights 1 the risk set is 120 with 21 deaths, giving 0.75 times 0.825, or 0.61875, 3.4 percentage points too high, as in the article.
S_1 = 0.75; w_1 = 1; d_1 = 12; n_1 = 30; w_2 = 1; d_2 = 9; n_2 = 90; S_2 = 0.61875
Year-2 survival with stabilised weights
Weights of 1.6 and 0.8 give 26.4 weighted deaths in a weighted risk set of 120, the same conditional survival of 0.78 and 0.585 at two years, as in the article.
S_1 = 0.75; w_1 = 1.6; d_1 = 12; n_1 = 30; w_2 = 0.8; d_2 = 9; n_2 = 90; S_2 = 0.585
Year-2 survival with three heavily weighted non-switchers
With 3 progressed non-switchers weighted 20 and one death among them, survival is 0.75 times (1 minus 29 / 150), about 0.605; with two deaths it falls to 0.505, as in the article.
S_1 = 0.75; w_1 = 20; d_1 = 1; n_1 = 3; w_2 = 1; d_2 = 9; n_2 = 90; S_2 = 0.605
Common errors
Censoring switchers without weighting
Because switchers came from the poorer-prognosis group, simple censoring raises two-year survival from 0.585 to 0.619; the NICE manual advises avoiding censoring or excluding patients who cross over, because these methods are very susceptible to selection bias.
Assuming censoring at switch is conservative
The bias runs in the direction of who switches: if poorer-prognosis patients switch, as here, control survival is overstated and the benefit understated; if fitter patients switch, the bias reverses.
Sources
Kaplan-Meier, log-rank and Cox estimators replaced by IPCW versions
Latimer NR, Abrams KR. NICE DSU Technical Support Document 16: Adjusting survival time estimates in the presence of treatment switching. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; 2014. Section 3.2.1: if the no unmeasured confounders assumption is approximately true, the selection bias associated with the dependence between censoring and failure can be corrected by replacing the Kaplan-Meier estimator, log-rank test and Cox partial likelihood estimator of the hazard ratio with their IPCW versions; section 3.1.2: censoring switchers is prone to selection bias through informative censoring because randomisation balance is broken if switching is associated with prognosis.
Avoid censoring or excluding patients who cross over
National Institute for Health and Care Excellence. NICE technology appraisal and highly specialised technologies guidance: the manual (PMG36). London: NICE; 2022, last updated 31 March 2026. Section 4.6.26: in RCTs where control patients switch to the technology, statistical methods adjusting for switching can be presented when intention-to-treat analysis is considered inappropriate; avoid simple adjustment methods such as censoring or excluding data from patients who crossover, because they are very susceptible to selection bias.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0