Competing risks stackplot

We can investigate the data for a given competing risks group of states with a probability stackplot.
Let's see this in action using the AIDSI dataset:

# Load and prep data
from pymsm.datasets import load_aidssi, prep_aidssi
data = load_aidssi()
competing_risk_dataset, covariate_cols, state_labels = prep_aidssi(data)
from pymsm.plotting import competingrisks_stackplot

competingrisks_stackplot(
    data=competing_risk_dataset,
    duration_col='time_transition_to_target',
    event_col ='target_state',
    order_top= [2],
    order_bottom = [3],
    state_labels = state_labels);

in this stackplot we can investigate the state occupancies at any given time. in white we have the "Event-Free" state occupancy, and as time goes by the "AIDS" and "SI" get populated. At t=14, we see that we have no "event-free" patients left in this dataset.