
Summarise Multi-State Occupation Probabilities over time
Source:R/summariseMultiStateProbabilities.R
summariseMultistateProbabilities.RdSummarise Multi-State Occupation Probabilities over time
Arguments
- cohort
A
cohort_tableobject containing one cohort for each state in the multi-state model. Cohort names must match the state names intrans.- trans
Transition matrix describing the states and transitions in the multi-state model. If S is the number of states in the multi-state model, trans should be an S x S matrix, with (i,j)-element a positive integer if a transition from i to j is possible in the multi-state model, NA otherwise. In particular, all diagonal elements should be NA. The integers indicating the possible transitions in the multi-state model should be sequentially numbered, 1,...,K, with K the number of transitions.
- strata
List of character vectors defining stratifications. Each character vector identifies one or more columns in
cohort; a separate model is fitted for each stratification. The value of strata can not change in each individual.- followUpDays
Maximum number of days of follow-up for which to estimate state occupation probabilities. Use
Infto include all available follow-up.- eventDate
Name of the date column in
cohortthat identifies when an individual enters a state.- censorDate
Name of the date column in
cohortthat identifies the end of follow-up, inclusive. IfNULL, the end of each individual's observation period is used.- stateHierarchy
Character vector of state names in the order used to resolve states that occur on the same date, with earlier entries occurring first. An empty character vector applies no hierarchy.
- stateStep
Numeric increment used to separate states that occur on the same date according to
stateHierarchy.