## use the simulated rectal cancer cohort
sr <- copy(sire)
sr$agegr <- cut(sr$dg_age, c(0,45,60,Inf), right=FALSE)
## usable straight away after splitting
fb <- c(0,3/12,6/12,1,2,3,4,5)
x <- lexpand(sr, breaks = list(fot=fb), pophaz=popmort, status=status)
rpm <- relpois(x, formula = lex.Xst %in% 1:2 ~ FOT + agegr)
## some methods for glm work. e.g. test for interaction
# rpm2 <- relpois(x, formula = lex.Xst \%in\% 1:2 ~ FOT*agegr)
# anova(rpm, rpm2, test="LRT")
# AIC(rpm, rpm2)
Run the code above in your browser using DataLab