transMatMSM: Define transition matrix for multi-state model.

Description Usage Arguments Value Author(s) Examples

View source: R/transMatMSM.R

Description

Define transition matrices for multi-state model. Specific functions for defining such transition matrices are pre-defined for common multi-state models like the competing risks model and the illness-death model.

Usage

1
transMatMSM(positions, namesStates)

Arguments

positions

List of possible transitions; x[[i]] consists of a vector of state numbers reachable from state i.

namesStates

A character vector containing the names of either the competing risks or the states in the multi-state model specified by the competing risks or illness-death model. names should have the same length as the list x (for transMat), or either K or K+1 (for trans.comprisk), or 3 (for trans.illdeath).

Value

A transition matrix describing the states and transitions in the multi-state model.

Author(s)

Gustavo Soutinho and Luis Meira-Machado.

Examples

1
2
3
4
5
data("ebmt4")
db_wide <- ebmt4
positions<-list(c(2, 3, 5, 6), c(4, 5, 6), c(4, 5, 6), c(5, 6), c(6), c())
namesStates = c("Tx", "Rec", "AE", "Rec+AE", "Rel", "Death")
transMatMSM(positions, namesStates)

gsoutinho/markovMSM documentation built on Nov. 9, 2021, 11:40 p.m.