ComenzarEmpieza gratis

Cox PH model survival time

You used both the Weibull AFT model and the Cox PH model to model time-to-arrest for convicts. Using the Weibull AFT model, you estimated the impact on survival time from changes in the covariates.

Could you do the same with the Cox PH model? Fit the Cox PH model to the prison data and calculate the impact on survival time from a one unit increase in prio (number of prior arrests).

The CoxPHFitter class has been imported for you, 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.

Este ejercicio forma parte del curso

Survival Analysis in Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Instantiate CoxPHFitter class
cph = ____

# Fit cph to data using all columns
____
Editar y ejecutar código