paths.Lexis {Epi} | R Documentation |
Generate paths travelled through a Lexis multistate model data frame.
Description
Paths visited in a Lexis
multistate model.
Usage
## S3 method for class 'Lexis'
paths(Lx, dfr = FALSE, ...)
Arguments
Lx |
A |
dfr |
Logical. Should results be returned as a data frame with
columns |
... |
Arguments passed on. Ignored |
Value
A factor with levels describing each person's path through states. It is
of length length(nid(Lx))
, named by the (character)
values of Lx$lex.id
. If dfr
is TRUE
a two-column
data frame is returned.
Author(s)
Bendix Carstensen, b@bxc.dk, http://bendixcarstensen.com
See Also
cutLexis
,
mcutLexis
,
rcutLexis
,
nid
,
Lexis
Examples
# a simple example
example(DMlate)
summary(dmi)
str(paths.Lexis(dmi, dfr = TRUE))
str(pathD <- paths.Lexis(dmi))
cbind(addmargins(table(pathD)))
#
# an example with recurring events
example(steno2)
summary(L4)
str(pathS <- paths.Lexis(L4))
cbind(addmargins(table(pathS)))
[Package Epi version 2.60 Index]