cmp.rel  R Documentation 
Estimates the crude probability of death due to disease and due to population reasons
cmp.rel( formula = formula(data), data = parent.frame(), ratetable = relsurv::slopop, na.action, tau, conf.int = 0.95, precision = 1, add.times, rmap )
formula 
a formula object, with the response as a NOTE: The followup 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 
na.action 
a missingdata filter function, applied to the model.frame,
after any subset argument has been used. Default is

tau 
the maximum followup time of interest, all times larger than

conf.int 
the level for a twosided confidence interval on the survival curve(s). Default is 0.95. 
precision 
the level of precision used in the numerical integration of variance. Default is 1, which means that daily intervals are taken, the value may be decreased to get a higher precision or increased to achieve a faster calculation. The calculation intervals always include at least all times of event and censoring as border points. 
add.times 
specific times at which the value of estimator and its variance should be evaluated. Default is all the event and censoring times. 
rmap 
an optional list to be used if the variables are not organized
and named in the same way as in the 
NOTE: The followup 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.
Note that numerical integration is required to calculate the variance
estimator. The integration precision is set with argument precision
,
which defaults to daily intervals, a default that should give enough
precision for any practical purpose.
The area under the curve is calculated on the interval [0,tau
].
Function summary
may be used to get the output at specific points in
time.
An object of class cmp.rel
. Objects of this class have
methods for the functions print
and plot
. The summary
function can be used for printing output at required time points. An object
of class cmp.rel
is composed of several lists, each pertaining the
cumulative hazard function for one risk and one strata. Each of the lists
contains the following objects:
time 
the timepoints at which the curves are estimated 
est 
the estimate 
var 
the variance of the estimate 
lower 
the lower limit of the confidence interval 
upper 
the upper limit of the confidence interval 
area 
the
area under the curve calculated on the interval [0, 
index 
indicator of event and censoring times among all the times in
the output. The times added via paramater 
add.times 
the times added via parameter 
Package: Pohar Perme, M., Pavlic, K. (2018) "Nonparametric Relative Survival Analysis with the R Package relsurv". Journal of Statistical Software. 87(8), 127, doi: "10.18637/jss.v087.i08"
rs.surv
, summary.cmp.rel
data(slopop) data(rdata) #calculate the crude probability of death #note that the variable year must be given in a date format and that #age must be multiplied by 365.241 in order to be expressed in days. fit < cmp.rel(Surv(time,cens)~sex,rmap=list(age=age*365.241), ratetable=slopop,data=rdata,tau=3652.41) fit plot(fit,col=c(1,1,2,2),xscale=365.241,xlab="Time (years)") #if no strata are desired: fit < cmp.rel(Surv(time,cens)~1,rmap=list(age=age*365.241), ratetable=slopop,data=rdata,tau=3652.41)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.