Skip to contents

quantile() gives the time by which a given proportion of subjects have had the event. median() is the 0.5 quantile. When the curve drops past the level inside an interval that isn't a single point, the data don't say where in the interval, so time is NA and time_low and time_high are the interval's bounds. These bound what the data identify and aren't confidence limits. Otherwise all three are the same. All three are NA when the curve never drops far enough.

Usage

# S3 method for class 'turnbull'
quantile(x, probs = 0.5, ...)

# S3 method for class 'turnbull'
median(x, na.rm = FALSE, ...)

Arguments

x

A turnbull() fit.

probs

Proportions of subjects who have had the event, between 0 and 1.

...

Unused.

na.rm

Unused. Present for compatibility with the generic.

Value

A data frame with one row per group and probability: strata, the grouping variables, prob, time, time_low, and time_high. median() omits prob.

Examples

visits <- data.frame(
  lower = c(0, 4, 7, 0, 3, 5),
  upper = c(4, NA, 7, 2.5, 6, 5)
)
fit <- turnbull(Surv(lower, upper, type = "interval2") ~ 1, data = visits)
median(fit)
#>   strata time time_low time_high
#> 1    all    5        5         5
quantile(fit, probs = c(0.25, 0.5))
#>   strata prob time time_low time_high
#> 1    all 0.25   NA        0       2.5
#> 2    all 0.50    5        5       5.0