tmat.Lexis
returns a square transition matrix, classified by the
levels of lex.Cst
and lex.Xst
, for every transition
occurring the entry is the number of transitions occurring and NA
in all oter entries. If Y=TRUE
, the diagonal will contain the
risk time in each of the states.
stack.Lexis
returns a dataframe to be used for analysis of
multistate data when all transitions are modelled together, for example
if some parameters are required to be the same for different transitions.
The dataframe has class stacked.Lexis
, and inherits the
attributes time.scales
and breaks
from the Lexis
object, and so function timeBand
applies to a
stacked.Lexis
object too.
The dataframe has same variables as the original Lexis
object,
but with each record duplicated as many times as there are possible
exits from the current state, lex.Cst
. Two variables are added:
lex.Fail
, an indicator of wheter an event for the transition
named in the factor lex.Tr
has occurred or not. lex.Tr
is
a factor with levels made up of combinations of the levels of
lex.Cst
and lex.Xst
that do occur together in x
,
joined by a "->
".