predict() reads the survival curve of each group at the given times. Outside the maximal
intersection intervals that aren't single points, the curve is a right-continuous step
function, 1 before the first interval. Strictly inside such an interval it isn't identified by
the data, and the estimate is NA.
Usage
# S3 method for class 'turnbull'
predict(object, times, ...)Arguments
- object
A
turnbull()fit.- times
One or more times.
- ...
Unused.
Value
A data frame with one row per group and time: strata, the grouping variables, time,
and estimate.
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)
# NA at time 1, inside the interval (0, 2.5]
predict(fit, times = c(1, 2.5, 5, 7))
#> strata time estimate
#> 1 all 1.0 NA
#> 2 all 2.5 0.6666667
#> 3 all 5.0 0.2222222
#> 4 all 7.0 0.0000000