Learn R Programming

Epi (version 1.0.7)

tab: Tabulate transitions and risk time from a Lexis object

Description

A two-way table of records and transitions classified by states (lex.Cst and lex.Xst), as well the risk time in each state.

Usage

## S3 method for class 'Lexis':
tab( x, simplify=TRUE, scale=1, ... )

Arguments

x
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.
...
Other parameters - ignored

Value

  • A matrix with rows classified by states where persons spend time, and columns classified by stated to which persons transit. Two additonal columns of transitions from and time spent in each state is added.

Details

The first part of the table gives the number of rows in the Lexis object, classified by states. The D column is the number of transitions i.e. rows where lex.Cst != lex.Xst, and the final column Y is the person-years spent in each state.

Examples

Run this code
data( nickel )
nic <- Lexis( data=nickel,
             entry=list(age=agein),
              exit=list(age=ageout,cal=ageout+dob,tfh=ageout-age1st),
# Lung cancer deaths and other deaths are coded 1 and 2
       exit.status=(icd > 0) + (icd %in% c(162,163))  )
str( nic )
head( nic )
tab.Lexis( nic )
tab( nic )

Run the code above in your browser using DataLab