| Title: | Plot Adjusted Kaplan-Meier Estimates from a Landmark Time |
|---|---|
| Description: | Plots contextual landmark Kaplan-Meier curves. An extension of the 'survminer::ggsurvplot()' function that allows the specification of a landmark time and an optional label. The period before the landmark is displayed as a pooled survival curve, while curves beyond the landmark are presented according to the groups defined in the supplied 'survival::survfit' object. |
| Authors: | Chris Brown [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-2506-4871>) |
| Maintainer: | Chris Brown <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.2.0 |
| Built: | 2026-10-16 09:06:06 UTC |
| Source: | https://github.com/cstats/landmarked |
Recreate a dataset from a survfit object
dataset_from_survfit(fit)dataset_from_survfit(fit)
fit |
A survfit object from the 'survival' package. |
The data.frame with variables: time, status, and strata (if applicable).
fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) dataset_from_survfit(fit)fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) dataset_from_survfit(fit)
Plot and adjusted Kaplan-Meier curve accounting for landmark analysis
ggsurvplotlm(fit, landmark_time = 6, landmark_label = "Landmark Time", ...)ggsurvplotlm(fit, landmark_time = 6, landmark_label = "Landmark Time", ...)
fit |
A survfit object from the 'survival' package. |
landmark_time |
The time at which to perform the landmark analysis |
landmark_label |
The label to use for the landmark time in the plot |
... |
Additional arguments passed to [survminer::ggsurvplot()]. |
The modified ggsurvplot object.
fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) ggsurvplotlm(fit, landmark_time = 70, landmark_label = "Landmark Time",axes.offset=FALSE)fit = survival::survfit(survival::Surv(time, status) ~ sex, data = survival::lung) ggsurvplotlm(fit, landmark_time = 70, landmark_label = "Landmark Time",axes.offset=FALSE)