Preparing a dataset
Preparing a dataset for multistate modeling with PyMSM¤
The first step of any multistate model is to provide the sample data of paths and covariates.
There are 2 types of dataset formats which can serve as an input:
1) a list of PathObject
2) a pandas data frame in the format used to fit the CompetingRiskModel
class
1. A list of PathObject
¤
Best to see an example:
The dataset is a list of elements from class PathObject. Each PathObject in the list corresponds to a single sample’s (i.e “patient’s”) observed path.
Let’s look at one such object in detail:
2. A pandas dataframe¤
a pandas data frame in the format used to fit the CompetingRiskModel
class. Let's see one: