Learn practical skills, build real-world projects, and advance your career

Survival Estimates that Vary with Time

Welcome to the third assignment of Course 2. In this assignment, we'll use Python to build some of the statistical models we learned this past week to analyze surivival estimates for a dataset of lymphoma patients. We'll also evaluate these models and interpret their outputs. Along the way, you will be learning about the following:

  • Censored Data
  • Kaplan-Meier Estimates
  • Subgroup Analysis

1. Import Packages

We'll first import all the packages that we need for this assignment.

  • lifelines is an open-source library for data analysis.
  • numpy is the fundamental package for scientific computing in python.
  • pandas is what we'll use to manipulate our data.
  • matplotlib is a plotting library.
import lifelines
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

from util import load_data

from lifelines import KaplanMeierFitter as KM
from lifelines.statistics import logrank_test

2. Load the Dataset