rsadd | R Documentation |
The function fits an additive model to the data. The methods implemented are the maximum likelihood method, the semiparametric
method, a glm model with a binomial
error and a glm model with a poisson
error.
rsadd(formula, data=parent.frame(), ratetable = relsurv::slopop, int, na.action, method, init,bwin,centered,cause,control,rmap,...)
formula |
a formula object, with the response as a NOTE: The follow-up time must be in days. |
data |
a data.frame in which to interpret the variables named in
the |
ratetable |
a table of event rates, organized as a |
int |
either a single value denoting the number of follow-up years or a vector
specifying the intervals (in years) in which the hazard is constant (the times that are
bigger than |
na.action |
a missing-data filter function, applied to the model.frame,
after any subset argument has been used. Default is
|
method |
|
init |
vector of initial values of the iteration. Default initial value is zero for all variables. |
bwin |
controls the bandwidth used for smoothing in the EM algorithm. The follow-up time is divided into quartiles and
|
centered |
if |
cause |
A vector of the same length as the number of cases. |
control |
a list of parameters for controlling the fitting process.
See the documentation for |
rmap |
an optional list to be used if the variables are not
organized and named in the same way as in the |
... |
other arguments will be passed to |
NOTE: The follow-up time must be specified in days. The ratetable
being used may have different variable names and formats than the user's data set, this is dealt with by the rmap
argument. For example, if age is in years in the data set but in days in the ratetable
object, age=age*365.241 should be used. The calendar year can be in any date format (date, Date and POSIXt are allowed), the date formats in the ratetable
and in the data may differ.
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.
An object of class 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:
data |
the data as used in the model, along with the variables defined in the rate table |
ratetable |
the ratetable used. |
int |
the maximum time (in years) used. All the events at and after this value are censored. |
method |
the fitting method that was used. |
linear.predictors |
the vector of linear predictors, one per subject. |
Package. Pohar M., Stare J. (2006) "Relative survival analysis in R." Computer Methods and Programs in Biomedicine, 81: 272–278
Relative survival: Pohar, M., Stare, J. (2007) "Making relative survival analysis relatively easy." Computers in biology and medicine, 37: 1741–1749.
EM algorithm: Pohar Perme M., Henderson R., Stare, J. (2009) "An approach to estimation in relative survival regression." Biostatistics, 10: 136–146.
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.241 in order to be expressed in days. fit <- rsadd(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365.241), 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,rmap=list(age=age*365.241), ratetable=slopop,data=rdata,int=5,method="EM") sm <- epa(fit) plot(sm$times,sm$lambda,type="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.