Skip to main content
HomePython

Survival Analysis in Python

Use survival analysis to work with time-to-event data and predict survival time.

Start Course for Free
4 hours16 videos48 exercises4,616 learnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies


Course Description

How long does it take for flu symptoms to show after exposure? And what if you don't know when people caught the virus? Do salary and work-life balance influence the speed of employee turnover? Lots of real-life challenges require survival analysis to robustly estimate the time until an event to help us draw insights from time-to-event distributions. This course introduces you to the basic concepts of survival analysis. Through hands-on practice, you’ll learn how to compute, visualize, interpret, and compare survival curves using Kaplan-Meier, Weibull, and Cox PH models. By the end of this course, you’ll be able to model survival distributions, build pretty plots of survival curves, and even predict survival durations.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.
  1. 1

    Introduction to Survival Analysis

    Free

    What problems does survival analysis solve, and what is censorship? You’ll answer these questions as you explore survival analysis data, build survival curves, and make basic estimations of survival time.

    Play Chapter Now
    What is survival analysis?
    50 xp
    What problems does survival analysis solve?
    100 xp
    Choose the right data for survival analysis
    50 xp
    Why use survival analysis?
    50 xp
    Identify the censorship type
    50 xp
    Preprocess censored data
    100 xp
    First look at censored data
    100 xp
    Your first survival curve!
    50 xp
    Draw a survival curve
    100 xp
    Long live democracy!
    100 xp
  2. 2

    Survival Curve Estimation

    In this chapter, you’ll learn how the Kaplan-Meier model works and how to fit, visualize, and interpret it. You’ll then apply this model to explore how categorical variables affect survival and learn how to supplement your analysis using hypothesis testing methods like the log-rank test.

    Play Chapter Now
  3. 3

    The Weibull Model

    Discover how to model time-to-event data with parametric models. Learn how to use the Weibull model and the Weibull AFT model and what different purposes they serve. Use survival regression to make inferences about how covariates affect the survival function and learn how to select the best survival model for your data.

    Play Chapter Now
  4. 4

    The Cox PH Model

    Another chapter, another model! In this final chapter, you'll learn about the proportional hazards assumption and the role it plays in fitting and interpreting the Cox Proportional Hazards model. You’ll also learn how to predict new subjects' survival times using the Cox Proportional Hazards model.

    Play Chapter Now
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

datasets

Echocardiogram dataEmployee attrition dataRegimes dataPrison recidivism data

collaborators

Collaborator's avatar
Hadrien Lacroix
Collaborator's avatar
Maggie Matsui
Shae Wang HeadshotShae Wang

Senior Data Scientist at Ripple

Shae Wang is a Senior Data Scientist at Ripple. She works on applied machine learning problems in the payments space, blockchain analytics, and experimentation. Before joining the blockchain industry, Shae was a Data Scientist at Uber and worked on a wide range of problems from OCR modeling and churn modeling to causal inference. Prior to her role at Uber, Shae used Neural Net to predict stock market movements for a startup. Shae earned her Masters in Computer Science with a focus in Machine Learning and Bachelor's degree in Statistics from Northwestern University.
See More

What do other learners have to say?

Join over 15 million learners and start Survival Analysis in Python today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.