View source: R/summary.Lexis.r
summary.Lexis | R Documentation |
A two-way table of records and transitions classified by states
(lex.Cst
and lex.Xst
), as well the risk time in each state.
## S3 method for class 'Lexis'
summary(object, simplify = TRUE, scale = 1, by = NULL,
Rates = FALSE, timeScales = FALSE, ...)
## S3 method for class 'summary.Lexis'
print(x, ..., digits = 2)
object |
A Lexis object. |
simplify |
Should rows with 0 follow-up time be dropped? |
scale |
Scaling factor for the rates. The calculated rates are multiplied by this number. |
by |
Character vector of name(s) of variable(s) in
|
Rates |
Should a component with transition rates be returned (and printed) too? |
timeScales |
Should the names of the timescales and the indication of since which entry also be given? |
x |
A |
digits |
Number of digits after the decimal separator used when printing the summary. |
... |
Ignored. |
An object of class summary.Lexis
, a list with two components,
Transitions
and Rates
, each one a matrix with rows
classified by states where persons spent time, and columns classified
by states to which persons transit. The Transitions
contains
number of transitions and has 4 extra columns with number of records,
total number of events, total risk time and number of person
contributing attached. The Rates
contains the transitions
rates.
If the argument Rates
is FALSE (the default), then only the
first component of the list is returned.
Bendix Carstensen, http://bendixcarstensen.com
data( nickel )
# Lung cancer deaths and other deaths are coded 1 and 2
nic <- Lexis( data = nickel,
entry = list(age = agein),
exit = list(age = ageout,cal = ageout+dob,tfh = ageout-age1st),
exit.status = factor( (icd > 0) + (icd %in% c(162,163)),
labels = c("Alive","Other","Lung") ) )
str( nic )
head( nic )
summary( nic )
# More detailed summary, by exposure level
summary( nic, by = nic$exposure>5, Rates = TRUE, scale = 100 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.