There are various ways we can examine a model - both before and after we fit it:
-
Plot the states diagram from the data. This is one of the first things a researcher might want to look at. This will allow her to understand the avialble transitions.
-
Display a transition table containing all available transitions and censored events.
-
Compute and display a Path frequencies table. Understanding the data path statistics is important in multistate models and may uncover interesting findings.
-
Examine competing risks states stackplots from an origin state. Understand how different origin states paths behave over time.
States diagram¤
Transition table¤
Path frequencies¤
Examine competing risks from origin state¤
origin_state = 3
competing_risk_dataset = msm.competing_risk_dataset
competing_risk_dataset = competing_risk_dataset[competing_risk_dataset['origin_state'] == origin_state]
from pymsm.plotting import competingrisks_stackplot
competingrisks_stackplot(
data=competing_risk_dataset,
duration_col='time_transition_to_target',
event_col ='target_state',
order_top= [1],
order_bottom = [4,2],
state_labels = state_labels);