Learn R Programming

relsurv (version 2.0-9)

rs.diff: Test Net Survival Curve Differences

Description

Tests if there is a difference between two or more net survival curves using a log-rank type test.

Usage

rs.diff(formula, data, ratetable = relsurv::slopop, na.action,precision=1)

Arguments

formula

a formula object, with the response as a Surv object on the left of a ~ operator, and, if desired, terms separated by the + operator on the right. If the variables are not organized and named in the same way as in the population tables, a ratetable term must be added to match each subject to his/her expected cohort. A formula expression as for other survival models, of the form Surv(time, status) ~ predictors. Each combination of predictor values defines a subgroup. A strata term may be used to produce a stratified test.

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, organized as a ratetable object, such as slopop.

na.action

a missing-data filter function, applied to the model.frame, after any subset argument has been used. Default is options()$na.action.

precision

Precision for numerical integration. 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.

Value

a rsdiff object; can be printed with print.

Details

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.

References

Package: Pohar M., Stare J. (2006) "Relative survival analysis in R." Computer Methods and Programs in Biomedicine, 81: 272--278

Log-rank type test: Graffeo, N., Castell, F., Belot, A. and Giorgi, R. (2016) "A log-rank-type test to compare net survival distributions. Biometrics. doi: 10.1111/biom.12477"

See Also

rs.surv, survdiff

Examples

Run this code
# NOT RUN {
data(slopop)
data(rdata)
#calculate the relative survival curve
#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.
rs.diff(Surv(time,cens)~sex+ratetable(age=age*365.241,sex=sex,
      year=year),ratetable=slopop,data=rdata)
# }

Run the code above in your browser using DataLab