Procedure
Step-by-step procedure for comparing survival experience across independent groups.
1. Formulate Hypotheses
2. Choose Weight Function
| Test | When to Use | |
|---|---|---|
| Log-Rank | Proportional hazards assumed; balanced weighting | |
| Gehan / Breslow | Early differences matter more | |
| Tarone-Ware | Compromise between log-rank and Gehan |
3. Compute Test Components
For each group :
where:
- : ordered distinct event times (across all groups pooled)
- : events in group at
- : at risk in group just before
- : total events at
- : total at risk at
Under , each group’s expected events:
4. Compute Variance-Covariance Matrix
For :
For :
5. Compute Test Statistic
Note: Only components are needed because .
For (two-sample case):
6. Decision Rule
| Case | Statistic | Distribution | Reject if |
|---|---|---|---|
| (two-sided) | |||
| (one-sided) | or |
7. Interpret Results
The interpretation depends on the nature of the event :
| Event Type | ”Better” means | Survival Curve | Hazard |
|---|---|---|---|
| Time-to-relapse (death, recurrence) | Longer time | Higher | Lower |
| Time-to-recovery (healing, remission) | Shorter time | Lower | Higher |
Interpretation
For time-to-relapse: the group with the higher survival curve has better prognosis. For time-to-recovery: the group with the lower survival curve recovers faster. Always check which direction is “better” before interpreting test results.
R Implementation
library(survival)
# K-sample log-rank test
fit <- survdiff(Surv(time, status) ~ group)
fit
# Output: N, Observed, Expected, (O-E)^2/E, (O-E)^2/V, Chisq, df, p-valueExample: Cancer Stages (4 Groups)
Case: Larynx cancer patients grouped by disease stage (I, II, III, IV). Question: Does survival differ across stages?
fit <- survdiff(Surv(time, status) ~ as.factor(stage), data = dat)
fit # χ² with 3 dfInterpretation flow:
- Omnibus test:
survdiffgives overall with . If significant → at least two stages differ. - Direction check: KM curves plotted by stage show Stage I (highest) → Stage IV (lowest), suggesting monotonic ordering.
- Follow-up: If ordering exists, proceed to Trend Test to test whether hazard increases monotonically with stage.
- Partial comparisons: Test specific pairs (e.g., Stage II vs I) to identify which stages actually differ.
Interpretation
The omnibus k-sample test tells whether groups differ. The trend test tells in what direction. Always do the omnibus test first, then follow up with a trend test if groups have a natural ordering.