Skip to contents

predict() reads the cumulative hazard of each group at the given times, with its standard error and confidence limits. The curves are right-continuous step functions, so the value at time \(t\) is the last step at a time \(\le t\), and 0 before the first step.

Usage

# S3 method for class 'nelson_aalen'
predict(object, times, ...)

Arguments

object

A nelson_aalen() fit.

times

One or more times.

...

Unused.

Value

A data frame with one row per group and time: strata, the grouping variables, time, estimate, std_error, conf_low, and conf_high.

Examples

lung <- data.frame(
  time = c(306, 455, 1010, 210, 883, 1022, 310, 361, 218, 166),
  status = c(2, 2, 1, 2, 2, 1, 2, 2, 2, 2)
)
fit <- nelson_aalen(Surv(time, status) ~ 1, data = lung)
predict(fit, times = c(200, 400))
#>   strata time  estimate std_error   conf_low conf_high
#> 1    all  200 0.1000000 0.1000000 0.01408635 0.7099071
#> 2    all  400 0.8456349 0.3551853 0.37124402 1.9262220