O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Examining subset survival curves

As we did with the KM curves, we can also produce separate plots for subsets of the data. We will do this by applying the regression coefficients we obtained previously to subsets of the data, with each subset containing an approximately equal number of rows. That way, we will be able to compare the density across groups:

  • In the following code, we will first subset our original dataset (ChurnStudy) by gender
  • Then we will score the new subsets by applying the coefficients of CoxModel.1
  • We will then reduce the density of the plots by sampling 300 observations each from the males and females subsets
  • Finally, we will plot the results

Run the following code to produce some interesting subsets of the survival ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required