IniziaInizia gratis

Patient soreness treatment

You are studying a treatment for muscle soreness recurrence in patients. You want to use the Kaplan-Meier estimator to visualize the rate at which patients receiving the treatment encounter soreness episodes.

The DataFrame is called recur and contains columns

  • age: the age of the patient;
  • time_0: the time that the patient received the treatment;
  • time_1: the last time of an event, or the last time you measured a censored patient;
  • censor: whether the event is censored;

The pandas package is loaded as pd, the KaplanMeierFitter class is imported from lifelines, and the pyplot module has been import from matplotlib as plt.

Questo esercizio fa parte del corso

Survival Analysis in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Calculate duration
recur[____] = ____
Modifica ed esegui il codice