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