Get startedGet started for free

Explore gender-LVDD interaction

You wonder if the survival risk for heart patients with LVDD (Left Ventricular Diastolic Dysfunction) is higher or lower among female patients. A good way to analyze this is with an interaction term between gender_f (1 if the subject is female, 0 otherwise) and lvdd.

You are going to fit the Weibull AFT model with gender_f*lvdd and interpret their coefficients. The DataFrame you will use is called heart_patients.

The pandas and numpy packages are loaded as pd and np, the WeibullAFTFitter class has been imported for you, and a WeibullAFTFitter instance aft has been created.

This exercise is part of the course

Survival Analysis in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Fit custom model
____
Edit and Run Code