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, and rates per 100 PY
summary(nic, by = nic$exposure > 5,
Rates = TRUE,
scale = 100)
Run the code above in your browser using DataLab