transition_matrix: Create the transition matrix

Description Usage Arguments Value Examples

View source: R/model_functions.R

Description

Create the transition matrix

Usage

1
transition_matrix(no_states, tmat, list_prob, name_states = NULL)

Arguments

no_states

number of the health states

tmat

A transition matrix in the format from thepackage 'mstate'

list_prob

list of probabilities as in the order of transitions (row wise)

name_states

names of the health states

Value

value of the transition matrix

Examples

1
2
3
tmat <- rbind(c(1, 2), c(3, 4))
colnames(tmat) <- rownames(tmat) <- c("Healthy", "Dead")
transition_matrix(2, tmat, list_prob = c(0.2, 0.5, 0, 0.3))

sheejamk/MarkovModel documentation built on Jan. 23, 2020, 2:44 a.m.