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

Our first model

Cox modeling also starts with creating a survival object, as we did in previous examples. Other than that, a cox model looks very similar to a standard regression model with the response variables specified to the left of the ~ and the independent variables specified to the right.

In cox regression modeling, we use the coxph() function over the surv() function to specify the dependent variable. This can be done directly in the formula, or by assigning it to a new variable and specifying the new variable to the left of the ~.

Recall that in defining our original survival object we defined Xtenure2 as the time variable and Churn as the outcome of interest. In our example, we will specify coxph(Surv(Xtenure2, Churn) as the left ...

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