BaşlayınÜcretsiz Başlayın

Draw a survival curve

You are a sociologist studying how convicts behave after their release. The DataFrame prison contains the information from 432 convicts who were released from Maryland state prisons in the 1970s and who were followed up with one year after release. There are two main columns of interest:

  • week: the number of weeks elapsed since release
  • arrest: whether the convict has been re-arrested within one year after release

A Kaplan Meier survival function has been fitted for you and the model object is called prison_kmf. Can you visualize the survival curve of prison_kmf?

The matplotlib.pyplot library is imported as plt and the lifelines module has also been imported for you.

Bu egzersiz

Survival Analysis in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Plot the survival function
____

# Show the plot
____
Kodu Düzenle ve Çalıştır