10.11 Exercise

Using the above scripts, perform a univariable Kaplan Meier analysis to determine if ulcer influences overall survival. Hint: survival_object ~ ulcer.

Try modifying the plot produced (see Help for ggsurvplot). For example:

  • Add in a medial survival lines: surv.median.line="hv"
  • Alter the plot legend: legend.title = "Ulcer Present", legend.labs = c("No", "Yes")
  • Change the y-axis to a percentage: ylab = "Probability of survival (%)", surv.scale = "percent"
  • Display follow-up up to 10 years, and change the scale to 1 year: xlim = c(0,10), break.time.by = 1)
## Warning: Vectorized input to `element_text()` is not officially supported.
## Results may be unexpected or may change in future versions of ggplot2.