Summary
Landmark survival analysis involves splitting survival data into two periods, requiring a combined plot to visualize both periods seamlessly. The challenge is to ensure the second period’s curve starts at the correct survival probability from the first period at the landmark time point.
Root Cause
- Disjointed data handling: The two survival models are fitted separately, making it difficult to merge their results into a single plot.
- Lack of continuity: The second period’s curve must start at the survival probability of the first period at the landmark time, which is not natively supported by
ggsurvfit.
Why This Happens in Real Systems
- Modular analysis: Survival models are often fitted independently for different time periods, leading to disjointed results.
- Plotting limitations: Standard plotting tools like
ggsurvfitare designed for single models, not combined landmark analyses.
Real-World Impact
- Misinterpretation: Separate plots can mislead readers about the continuity of survival probabilities.
- Inefficiency: Manual adjustments to combine plots are error-prone and time-consuming.
Example or Code
# Combine survival data at landmark
combined_data <- bind_rows(
mutate(fit_0_365$surv_table, time_period = "0-365"),
mutate(fit_365_730$surv_table, time_period = "365-730", time = time + 365)
)
# Plot combined data
ggplot(combined_data, aes(x = time, y = surv, color = trt, linetype = gender)) +
geom_step() +
scale_x_continuous(breaks = seq(0, 730, 90), labels = c("0", "3", "6", "9", "12", "15", "18", "24")) +
labs(x = "Months since randomization", y = "Survival probability") +
theme_minimal()
How Senior Engineers Fix It
- Data alignment: Combine survival tables from both periods, adjusting time scales and survival probabilities at the landmark.
- Custom plotting: Use
ggplot2directly to ensure continuity and proper scaling, bypassingggsurvfitlimitations.
Why Juniors Miss It
- Over-reliance on tools: Juniors often assume
ggsurvfitcan handle all survival plotting needs without understanding its limitations. - Lack of data manipulation skills: Merging and adjusting survival tables requires advanced data wrangling, which juniors may not possess.