Model prison data with Cox PH
The DataFrame prison contains information from 432 convicts who were released and followed up for one year after release. You have modeled their time-to-arrest and studied what factors increase or decrease their risk of re-arrest using the Weibull AFT model.
CoxPHFitter class of lifelines implements a Cox Proportional Hazards model for survival regression that models the baseline hazard function and hazard ratios that define hazard proportions. Let's try using CoxPHFitter to explore the factors!
The pandas and numpy libraries are imported as pd and np, respectively. Use the console to explore the DataFrame and its column names as needed.
Deze oefening maakt deel uit van de cursus
Survival Analysis in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Import CoxPHFitter class
____
# Instantiate CoxPHFitter class cph
____