Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

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

Contrasting survival curves

A baseline survival curve by itself is useful, but the most meaningful analysis comes from looking at the different curves that are generated by different segments of groups. That way, you can see where any intervention might be required. To generate this curve for gender, we will again use the survfit() function and specify XGender on the right side of the ~ operator. This code will give us separate survival curves for male and female:

km.gender <- survfit(SurvObj ~ Xgender, data = ChurnStudy, conf.type = "log-log")km.gender                                          plot(km.gender,col=c('red','blue') ,lty=1:2)legend('left', col=c('red','blue') ,c('F', 'M'), lty=1:2)title(main = "Survival Curves by Gender")dev.copy(jpeg,'Ch5 - Survival Plot by Gender.jpg'); ...
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