Learn R Programming

relsurv (version 1.0)

rsadd: Fit an Additive model for Relative Survival

Description

The function fits an additive model to the data. The methods implemented are the maximum likelihood method, a glm model with a binomial error and a glm model with a poisson error.

Usage

rsadd(formula, data=parent.frame(), ratetable = survexp.us, int, na.action, method, init,control,...)

Arguments

formula
a formula object, with the response on the left of a ~ operator, and the terms on the right. The terms consist of predictor variables separated by the + operator, along with a ratetable term. The ratetable
data
a data.frame in which to interpret the variables named in the formula.
ratetable
a table of event rates, organized as a ratetable object, such as survexp.us.
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 max(int) are censored. If missing, the intervals are set to be one
na.action
a missing-data filter function, applied to the model.frame, after any subset argument has been used. Default is options()$na.action.
method
glm.bin or glm.poi for a glm model and max.lik for the maximum likelihood model (default).
init
vector of initial values of the iteration. Default initial value is zero for all variables.
control
a list of parameters for controlling the fitting process. See the documentation for glm.control for details.
...
Other arguments will be passed to glm.control.

Value

  • 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:
  • datathe original data, along with the variables defined in the rate table
  • warnmethe number of groups with the observed number of deaths is smaller than the expected.
  • ratetablethe ratetable used.
  • intthe maximum time (in years) used. All the events at and after this value are censored.
  • Additionally the glm models include:
  • groupslife tables for groups specified by the covariates.

Details

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.

References

Dickman P.W., Sloggett A., Hills M., Hakulinen T. "Regression models for relative survival." Statistics in Medicine, 2004.

See Also

rstrans, rsmul

Examples

Run this code
data(slopop)
data(rdata)
rsadd(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365.24,sex=sex,year=year),ratetable=slopop,data=rdata,int=5)

Run the code above in your browser using DataLab