populate_transition_matrix {packDAMipd}R Documentation

Populate transition matrix

Description

Populate transition matrix

Usage

populate_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 the package 'mstate'

list_prob

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

name_states

names of the health states

Details

If the state names are null, they are replaced with numbers starting from 1 First find those missing probabilities, and fill a list from the given list of probabilities and fill those are not NA in the matrix Note that the probabilities need not be numeric here and no checks are needed for sum

Value

value of the transition matrix

Examples

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

[Package packDAMipd version 1.1.0 Index]