transhelp: Help functions for transition matrix

transhelpR Documentation

Help functions for transition matrix

Description

Help functions to get insight into the structure of a transition matrix.

Arguments

trans

Transition matrix, for instance produced by transMat), trans.comprisk, or trans.illdeath

Details

Function to.trans2 simply lists the transitions in trans in a data frame; function trans2Q converts trans to a Q matrix, the (j,k)th element of which contains the (shortest) number of transitions needed to travel from the jth to the kth state; function absorbing returns a vector (named if trans contains row or columnc names) with the state numbers that are absorbing; function is.circular returns (a Boolean) whether the transition matrix specified in trans is circular or not.

Value

See details.

Author(s)

Hein Putter <H.Putter@lumc.nl>

Examples


# Irreversible illness-death model
tmat <- trans.illdeath(c("Healthy", "Illness", "Death"))
tmat
to.trans2(tmat)
trans2Q(tmat)
absorbing(tmat)
is.circular(tmat)
# Reversible illness-death model
tmat <- transMat(x = list( c(2, 3), c(1, 3), c() ),
                 names = c("Healthy", "Illness", "Death"))
tmat
to.trans2(tmat)
trans2Q(tmat)
absorbing(tmat)
is.circular(tmat)


mstate documentation built on Sept. 11, 2024, 7:32 p.m.