binomial
error and a glm model with a poisson
error.rsadd(formula, data=parent.frame(), ratetable = survexp.us,
int, na.action, method, init,bwin,centered,cause,control,...)
~
operator, and
the terms on the right. The terms consist of predictor variables separated by
the +
operator, along with a ratetable
term. The ratetable
formula
.ratetable
object, such as survexp.us
.max(int)
are censored. If missing, only one interval (from time 0 toptions()$na.action
.glm.bin
or glm.poi
for a glm model, EM
for the EM algorithm and max.lik
for the maximum likelihood model (default).bwin
specifies a factor by which the maximum between events time length on each interval is multiplied. The default
bwin
TRUE
, all the variables are centered before fitting and the baseline excess hazard
is calculated accordingly. Default is FALSE
.0
for population deaths, 1
for disease specific
deaths, 2
(default) for unknown. Can only be used with the EM
method.glm.control
for details.glm.control
.rsadd
. In the case of method="glm.bin"
and method="glm.poi"
the class also
inherits from glm
which inherits from the class lm
.
Objects of this class have methods for the functions print
and summary
.
An object of class rsadd
is a list containing at least the following components:ratetable
object, like age
and year
. On the contrary, the int
argument requires
interval specification in years.
The maximum likelihood method and both glm methods assume a fully parametric model with a piecewise constant baseline
excess hazard function. The intervals on which the baseline is assumed constant should be passed via argument int
. The
EM method is semiparametric, i.e. no assumptions are made for the baseline hazard and therefore no intervals need to be specified.
The methods using glm are methods for grouped data. The groups are formed according to the covariate values.
This should be taken into account when fitting a model. The glm method returns life tables for groups specified by the covariates in groups
.
The EM method output includes the smoothed baseline excess hazard lambda0
, the cumulative baseline excess hazard
Lambda0
and times
at which they are estimated. The individual probabilites of dying due to the excess risk
are returned as Nie
.
The EM method fitting procedure requires some local smoothing of the baseline excess hazard. The default bwin=-1
value lets the function find an appropriate value for the
smoothing band width. While this ensures an unbiased estimate, the procedure time is much longer. As the value found by
the function is independent of the covariates in the model, the value can be read from the output (bwinfac
) and
used for refitting different models to the same data to save time.rstrans
,
rsmul
data(slopop)
data(rdata)
#fit an additive model
#note that the variable year is given in days since 01.01.1960 and that
#age must be multiplied by 365 in order to be expressed in days.
fit <- rsadd(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365,
sex=sex,year=year), ratetable=slopop,data=rdata,int=5)
#check the goodness of fit
rs.br(fit)
#use the EM method and plot the smoothed baseline excess hazard
fit <- rsadd(Surv(time,cens)~sex+age+ratetable(age=age*365,
sex=sex,year=year), ratetable=slopop,data=rdata,int=5,method="EM")
sm <- epa(fit)
plot(sm$times,sm$lambda,type="l")
Run the code above in your browser using DataLab