Learn R Programming

survRatio (version 0.1)

drsurv: Bootstrap pointwise confidence bands for survival ratio and survival difference

Description

Estimate the survival ratio and survival difference accompanied by their pointwise confidence bands to provide a comparison of the survival prospects (S(t)) for independent and paired survival problems.

Usage

drsurv(time, status, factor, ref = NULL, tgrid = NULL, paired = FALSE, id = NULL,
  clevel = 0.95, nboot = 1000)

Arguments

time

a vector of the observed survival times.

status

a binary vector indicating the censoring status (typically 0 = 'censored', 1 = 'event').

factor

a binary vector indicating the group levels.

ref

the reference level (typically a string) used as the level to compare the survival prospects with.

tgrid

a sequence of follow-up time points to calculate survival estimates for.

paired

a logical indicator whether the survival data is paired. The defaults is paired = FALSE.

id

a pair identifier variable which must be provided for paired survival data problems (i.e. when paired = TRUE).

clevel

the confidence level used for constructing the pointwise confidence bands. The default is clevel = 0.95.

nboot

an integer indicating the number of bootstrap replicates. The defaults is nboot = 1000.

Value

A list of objects including a data frame of the estimates of survival ratio and survival difference accompanied by their pointwise confidence bands. In addition, it includes the confidence level used, the factor levels, the number of bootstrap replicates, whether an independent or paired design was used and the p-value from the log-ranke test of equality for independent designs.

References

Newell, J., Kay, J. W., & Aitchison, T. C. (2006). Survival ratio plots with permutation envelopes in survival data problems. Computers in biology and medicine, 36(5), 526-541.

See Also

Surv, ggsurv

Examples

Run this code
# NOT RUN {
require(survival)

##### Independent survival data
# }
# NOT RUN {
data(lung)
fit1 <- drsurv(time = lung$time, status = lung$status, factor = lung$sex)
ggsurv(fit1)

##### Paired survival data
data(retinopathy)
fit2 <- drsurv(retinopathy$futime, retinopathy$status, retinopathy$trt,
  paired = TRUE, id = retinopathy$id)
head(fit2$surv)
ggsurv(fit2, statistics = "all")
# }

Run the code above in your browser using DataLab