Learn R Programming

Epi (version 2.59)

paths.Lexis: Generate paths travelled through a Lexis multistate model data frame.

Description

Paths visited in a Lexis multistate model.

Usage

# S3 method for Lexis
paths(Lx, dfr = FALSE, ...)

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.

Arguments

Lx

A Lexis object

dfr

Logical. Should results be returned as a data frame with columns lex.id and path?

...

Arguments passed on. Ignored

Author

Bendix Carstensen, b@bxc.dk, http://bendixcarstensen.com

See Also

cutLexis, mcutLexis, rcutLexis, nid, Lexis

Examples

Run this code
# 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)))
  

Run the code above in your browser using DataLab