relpois {popEpi} | R Documentation |
Excess hazard Poisson model
Description
Estimate a Poisson piecewise constant excess hazards model
Usage
relpois(data, formula, fot.breaks = NULL, subset = NULL, check = TRUE, ...)
Arguments
data |
a dataset split with e.g. |
formula |
a formula which is passed on to |
fot.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. |
check |
logical; if |
... |
any argument passed on to |
Details
Basics
relpois
employs a custom link function of the Poisson variety
to estimate piecewise constant parametric excess hazards. The pieces
are determined by fot.breaks
. A log(person-years)
offset
is passed automatically to the glm
call.
Formula usage
The formula can be used like any ordinary glm
formula. The user must
define the outcome in some manner, which is usually lex.Xst
after splitting
with e.g. lexpand
. The exception is the possibility of including
the baseline excess hazard terms by including the
reserved term FOT
in the formula.
For example, lex.Xst != 0 ~ FOT + agegr
estimates a model with constant
excess hazards at the follow-up intervals as specified by
the pertinent breaks used in splitting data
,
as well as for the different age groups.
FOT
is created ad hoc if it is used in the formula.
If you leave out FOT
, the hazard is effectively
assumed to be constant across the whole follow-up time.
You can also simply use your own follow-up time interval variable that
you have created before calling relpois
. However, when using
FOT
, relpois
automatically checks for e.g.
negative excess cases in follow-up intervals,
allowing for quickly finding splitting breaks
where model estimation is possible. It also drops any data outside the
follow-up time window.
Splitting and merging population hazard
The easiest way to both split and to include population hazard information is
by using lexpand
. You may also fairly easily do it by hand
by splitting first and then merging in your population hazard information.
Data requirements
The population hazard information must be available for each record and named
pop.haz
. The follow-up time variable must be named "fot"
e.g.
as a result of using lexpand
. The lex.dur
variable must also
be present, containing person-year information.
Value
A glm
object created using a custom Poisson family construct. Some
glm
methods are applicable.
Author(s)
Joonas Miettinen, Karri Seppa
References
Paul W Dickman, Andy Sloggett, Michael Hills, and Timo Hakulinen. Regression models for relative survival. Stat Med. 2004 Jan 15;23(1):51-64. doi:10.1002/sim.1597
See Also
Other main functions:
Surv()
,
rate()
,
relpois_ag()
,
sir()
,
sirspline()
,
survmean()
,
survtab()
,
survtab_ag()
Other relpois functions:
RPL
,
relpois_ag()
,
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)
## usable straight away after splitting
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,
breaks = list(fot=fb), pophaz=popmort)
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)
## update() won't work currently