tab {Epi}R Documentation

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

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.

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.

Author(s)

Bendix Carstensen, bxc@steno.dk

Examples

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 )

[Package Epi version 1.0.7 Index]