get_quantile: Extended quantile S3 method - EXPERIMENTAL NEEDS TESTING AND...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/get_quantile.R

Description

S3 method for extracting quantiles. For survival objects, it takes into account the maximal time of survival as limit instead of NA If the quantile requested is larger than the minimal quantile available, the result is NA. No default method is available at the moment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
get_quantile(x, ...)

## S3 method for class 'survfit'
get_quantile(
  survfit_object = survfit_object,
  probs = c(0.25, 0.5, 0.75),
  conf.int = TRUE,
  tolerance = sqrt(.Machine$double.eps),
  debug = FALSE
)

Arguments

x

S3 object

...

other arguments passed on to the method

survfit_object

An object of class survfit

probs

numeric vector of probabilities with values in [0,1]

conf.int

should lower and upper confidence limits be returned?

tolerance

tolerance for checking that the survival curve exactly equals one of the quantiles

Value

A tibble with quantiles

Author(s)

Steven Haesendonckx

See Also

quantile.survfit

Examples

1
2
3
4
5
6
7
library(survival)
library(dplyr)
library(tidyr)

survfit_object_trt <- vr_KM_est(data = adtte, strata = c("TRTP"))
get_quantile(survfit_object)
quantile(survfit_object)

visR-sandbox/visR-survival documentation built on Sept. 18, 2020, 6:21 p.m.