Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

by Ralph Winters
June 2017
Beginner to intermediate content levelBeginner to intermediate
576 pages
15h 22m
English
Packt Publishing
Content preview from Practical Predictive Analytics

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Superstream: Analytics Engineering

Data Superstream: Analytics Engineering

Alistair Croll, Anna Filippova, Emilie Schario, Lewis Davies, Jacob Frackson, Benn Stancil, Nick Acosta, Elizabeth Caley
R: Predictive Analysis

R: Predictive Analysis

Tony Fischetti, Eric Mayor, Rui Miguel Forte
Python: Advanced Predictive Analytics

Python: Advanced Predictive Analytics

Ashish Kumar, Joseph Babcock

Publisher Resources

ISBN: 9781785886188Supplemental Content