I am creating a Kaplan-Meier plot that shows the relationship between family history of mental illness and mental illness onset using ggsurvplot from the survminer package. This is the code I have used:
km_fhr <- ggsurvplot(fit = survfit(Surv(fu_time, smidg) ~ fhr, data = df),
legend.labs = c("Control", "Family high-risk"),
legend.title = "",
censor.shape = 124,
censor.size = 2.5,
palette = c("#00ABE7", "#FFA69E")) +
labs(x = "Follow-up time (years)", y = "Probability of no SMI diagnosis")
The Kaplan-Meier curve looks like this:
It seems to me that it would be more intuitive to plot risk of illness (failure rate) rather than probability of no illness (survival rate) on the y-axis. I assume there is a simple way to do this, but I have not been able to find a description in the survminer documentation.
Thank you in advance!