Get startedGet started for free

Capstone: The Cox model

To conclude the course, let's take a look back at the lung cancer dataset we utilized briefly in these last 2 chapters. To recap, this dataset contains information on the survival of patients with advanced lung cancer from the North Central Cancer Treatment Group. The event is stored in the status variable, which has a value of 2 if an individual did not survive. The performance score (variable performance) measures how well a patient can perform usual daily activities (bad=0, good=100), rated by a physician. We want to know the association between specific performance scores and survival time.

This exercise is part of the course

Survival Analysis in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Compute Cox model and survival curves
cxmod <- ___(___(___, ___) ~ ___, data = lung)
new_lung <- data.frame(performance = ___)
cxsf <- ___(cxmod, data = ___, newdata = ___, conf.type = "none")
Edit and Run Code