Exercise

Computing the survival curve from a Cox model

In this exercise, we will reproduce the example from the video following the steps:

  • Compute Cox model
  • Decide on "imaginary patients"
  • Compute survival curves
  • Create data.frame with survival curve information
  • Plot

We will focus now on the first three steps in this exercise and do the next two steps in the upcoming exercise.

The survival and survminer packages and the GBSG2 data are loaded for you in this exercise.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Compute the Cox model for the GBSG2 data with covariates horTh and tsize.
  • Decide on "imaginary patients": the two levels of horTh and the 25%, 50%, and 75% quantile.
  • Add rownames letters "a" - "f" to the imaginary patients data.frame.