Procedure

Step-by-step procedure for comparing survival experience across independent groups.

1. Formulate Hypotheses

2. Choose Weight Function

TestWhen to Use
Log-RankProportional hazards assumed; balanced weighting
Gehan / BreslowEarly differences matter more
Tarone-WareCompromise 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

CaseStatisticDistributionReject if
(two-sided)
(one-sided) or

7. Interpret Results

The interpretation depends on the nature of the event :

Event Type”Better” meansSurvival CurveHazard
Time-to-relapse (death, recurrence)Longer timeHigher Lower
Time-to-recovery (healing, remission)Shorter timeLower 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-value

Example: 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 df

Interpretation flow:

  1. Omnibus test: survdiff gives overall with . If significant → at least two stages differ.
  2. Direction check: KM curves plotted by stage show Stage I (highest) → Stage IV (lowest), suggesting monotonic ordering.
  3. Follow-up: If ordering exists, proceed to Trend Test to test whether hazard increases monotonically with stage.
  4. 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.