rstrans {relsurv} | R Documentation |
The function transforms each person's time to his/her probability of dying at that time according to the ratetable. It then fits the Cox proportional hazards model with the transformed times as a response. It can also be used for calculatin the transformed times (no covariates are needed in the formula for that purpose).
rstrans(formula, data, ratetable, int,na.action,init,control,...)
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 term
matches each subject to his/her expected cohort.If the variables are organized and named
in the same way as in the population tables, the ratetable term can be omitted.
The response must be a survival object as returned by the Surv function.
NOTE: The time must be in days, and the same is required for the ratetable variables (the variables used in the population tables), for example age and year (year must be given in the date format, i.e. in number of days since 01.01.1960).
|
data |
a data.frame in which to interpret the variables named
in the formula .
|
ratetable |
a table of event rates, such as survexp.us .
|
int |
the number of follow-up years used for calculating survival(the rest is censored). If missing, it is set the the maximum observed follow-up time. |
na.action |
a missing-data filter function, applied to the model.frame,
after any subset argument has been used. Default is
options()$na.action . |
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 coxph.control for details.
|
... |
other arguments will be passed to coxph.control . |
NOTE: All times used in the formula argument must be specified in days. This is true for the follow-up time as well as for
any variables needed ratetable
object, like age
and year
. On the contrary, the int
argument requires
interval specification in years.
an object of class coxph
. See coxph.object
and coxph.detail
for details.
y |
an object of class Surv containing the transformed times (these times do not depend on covariates).
|
rsmul
, invtime
, rsadd
, survexp
.
data(slopop) data(rdata) #fit a Cox model using the transformed times #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 <- rstrans(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365, sex=sex,year=year),ratetable=slopop,data=rdata) #check the goodness of fit rs.br(fit)