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 Lexis
summary(object, simplify = TRUE, scale = 1, by = NULL,
Rates = FALSE, timeScales = FALSE, ...)
# S3 method for summary.Lexis
print(x, ..., digits = 2)
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.
A Lexis object.
Should rows with 0 follow-up time be dropped?
Scaling factor for the rates. The calculated rates are multiplied by this number.
Character vector of name(s) of variable(s) in
object
. Used to give a separate summaries for subsets of
object
. If longer than than 1, the interaction between that
variables is used to stratify the summary. It is also possible to
supply a vector of length nrow(object)
, and the distinct
values of this will be used to stratify the summary.
Should a component with transition rates be returned (and printed) too?
Should the names of the timescales and the indication of since which entry also be given?
A Lexis
or summary.Lexis
object.
Number of digits after the decimal separator used when printing the summary.
Ignored.
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 )
Run the code above in your browser using DataLab