## 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, birth = bi_date, entry = dg_date,
exit = ex_date, status=status %in% 1:2,
breaks = list(fot=fb),
pophaz=popmort, pp = FALSE,
aggre = list(agegr, fot))
rpm <- relpois_ag(formula = from0to1 ~ fot + agegr, data = x,
d.exp = d.exp, offset = log(pyrs))
summary(rpm)
## the usual functions for handling glm models work
rpm2 <- update(rpm, . ~ fot*agegr)
anova(rpm, rpm2, test="LRT")
AIC(rpm, rpm2)
Run the code above in your browser using DataLab