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

Obtaining the cox survival curves

We can obtain survival curves for the Cox model in a similar fashion as we did for the KM models. To obtain the data points for the curve, use summary(survfit(CoxModel.1)), which will also display the confidence intervals, count of the number of members who churned (n.event), and the number of members at risk (n.risk):

> summary(survfit(CoxModel.1))Call: survfit(formula = CoxModel.1) time n.risk n.event survival std.err lower 95% CI upper 95% CI    1   1488      15    0.993 0.00185        0.989        0.996    2   1455      52    0.967 0.00404        0.960        0.975    3   1393      34    0.950 0.00505        0.940        0.960    4   1342      20    0.940 0.00559        0.929        0.951    5   1315      39    0.919 0.00655        0.906        0.932    6   1245      42    0.896 0.00752        0.881        0.911    7   1156      60    0.861 0.00884        0.844        0.879 8 1020 68 0.818 ...

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