relpois_ag {popEpi} | R Documentation |
Excess hazard Poisson model
Description
Estimate a Poisson Piecewise Constant Excess Hazards Model
Usage
relpois_ag(
formula,
data,
d.exp,
offset = NULL,
breaks = NULL,
subset = NULL,
piecewise = TRUE,
check = TRUE,
...
)
Arguments
formula |
a formula with the counts of events as the response.
Passed on to |
data |
an |
d.exp |
the counts of expected cases. Mandatory.
E.g. |
offset |
the offset for the Poisson model, supplied as e.g.
|
breaks |
optional; a numeric vector of [a,b) breaks to specify
survival intervals over the follow-up time; if |
subset |
a logical vector or condition; e.g. |
piecewise |
|
check |
|
... |
any other argument passed on to |
Value
A relpois
object created using a custom Poisson family construct.
Author(s)
Joonas Miettinen, Karri Seppa
See Also
Other main functions:
Surv()
,
rate()
,
relpois()
,
sir()
,
sirspline()
,
survmean()
,
survtab()
,
survtab_ag()
Other relpois functions:
RPL
,
relpois()
,
rpcurve()
Examples
## use the simulated rectal cancer cohort
data(sire, package = "popEpi")
sire$agegr <- cut(sire$dg_age, c(0,45,60,Inf), right=FALSE)
## create aggregated example data
fb <- c(0,3/12,6/12,1,2,3,4,5)
x <- lexpand(sire, 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))
## fit model using aggregated data
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)
## other features such as residuals or predicting are not guaranteed
## to work as intended.