How do prior arrests impact re-arrest rate?
During the study of the prison
data, you obtain new information about each convict, such as the number of convictions prior to current incarceration prio
.
You want to visualize how different values of prio
impact the baseline survival function modeled with WeibullAFTFitter
.
The WeibullAFTFitter
class has been imported and a new instance aft
has been created. The matplotlib.pyplot
library is imported as plt
, and 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.
This exercise is part of the course
Survival Analysis in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Fit data to aft
____