Closed slobaugh closed 5 months ago
Hi @slobaugh !
I think we spoke about this request a few years ago, right? The ggsurvfit behavior mimics what is done in the survival package. That said, I am not against the change. But I probably wouldn't put the effort into making the change myself.
I think this would require an update to the geom_step_ribbon()
function. Let me know if it's something you'd like to pursue.
library(ggsurvfit)
#> Loading required package: ggplot2
# create data
df_fake <- tibble::tribble(
~time, ~status,
24.0164271047228, 1,
24.1478439425051, 1,
24.3121149897331, 0,
25.1334702258727, 1,
25.9876796714579, 1,
26.4804928131417, 0,
26.7433264887064, 1,
26.9733059548255, 0,
27.5975359342916, 0,
29.0102669404517, 1,
31.7043121149897, 0,
33.1827515400411, 0,
33.5770020533881, 0,
58.5770020533881, 0,
63.5770020533881, 1
)
survfit(Surv(time, status) ~ 1, data = df_fake) |> plot()
Created on 2024-05-21 with reprex v2.1.0
@slobaugh is this something you're interested in doing? 💯
Thanks @ddsjoberg, we did chat briefly about this in person a while ago! I feel similarly to you in that I probably won't put the effort into making the change myself 🙈 but I really appreciate the reminder that ggsurvfit is mimicking the survival package's behavior here. Please close this issue as you see fit!
OK, I'll go ahead and close. If you ever feel the motivation to make it happen, re-open the issue :)
Is your feature request related to a problem? Please describe. Confidence bands drawn in a KM curve created using ggsurvfit + add_confidence_interval() do not necessarily appear for all of the times for which they are defined.
Describe the solution you'd like Sometimes I provide KM survival estimates for a time-point past where the confidence bands end in the associated plot created using ggsurvfit, and it would be nice if the plot aligned with the estimates for consistency. I would like for the confidence bands to appear in the plot for all of the times for which they are defined.
Describe alternatives you've considered I could use survminer::ggsurvplot instead. My reprex below compares the behavior of this function with ggsurvfit.
Additional context Reprex:
Created on 2024-05-21 with reprex v2.1.0