Aan de slagGa gratis aan de slag

Visualizing 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 last two steps in this exercise.

The survival and survminer packages and the GBSG2 data are loaded for you in this exercise. The Cox model cxmod, the imaginary patient data newdat, and the survival curve information cxsf from the previous exercise are also available.

Deze oefening maakt deel uit van de cursus

Survival Analysis in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Compute data.frame needed for plotting
surv_cxmod0 <- ___(cxsf)

# Look at the first few lines
___(surv_cxmod0)
Code bewerken en uitvoeren