
rstrans(formula, data, ratetable, int,na.action,init,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
.survexp.us
.options()$na.action
.coxph.control
for details.coxph.control
.coxph
. See coxph.object
and coxph.detail
for details.Surv
containing the transformed times (these times do not depend on covariates).ratetable
object, like age
and year
. On the contrary, the int
argument requires
interval specification in years.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)
Run the code above in your browser using DataLab