BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Survival Analysis in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Instantiate CoxPHFitter class
cph = ____

# Fit cph to data using all columns
____
Kodu Düzenle ve Çalıştır