Get startedGet started for free

Plotting the survival curve

You learned that there are different ways to plot the survival function from the Kaplan-Meier estimator. A survival function on the term lengths of Canadian senators has been fitted for you using KaplanMeierFitter and the instance is called senator_kmf. Try plotting senator_kmf in the console. After each plot, you may run plt.clf() to clear the figure.

Select the correct ways to plot the survival function.

  • A. senator_kmf.plot_survival_function()
  • B. senator_kmf.plot_survival_distribution()
  • C. senator_kmf.survival_function_.plot()
  • D. plt.plot(senator_kmf)
  • E. senator_kmf.plot()

This exercise is part of the course

Survival Analysis in Python

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise