Learn R Programming

ggRandomForests (version 4.0.0)

gg_auct: Tidy time-varying AUC from a Random Hazard Forest

Description

Extracts the time-dependent AUC curve from randomForestRHF::auct.rhf() into a tidy long data frame, one row per time point, with bootstrap confidence bounds when available and the integrated AUC (iAUC) summary attached as an attribute.

Usage

gg_auct(object, ...)

# S3 method for auct.rhf gg_auct(object, ...)

# S3 method for rhf gg_auct( object, marker = c("chf", "haz"), auct_fit = NULL, method = c("cumulative", "incident"), ... )

Value

A data.frame of class c("gg_auct", "data.frame") with columns time, auc, se, lower, upper, marker (CI columns NA when no bootstrap), an iauc attribute (a list with uno, std, uno.se, std.se, conf.level), a method attribute ("cumulative" or "incident", taken from the auct.rhf fit, which is what plot.gg_auct() names on its y axis), and a provenance attribute derived from object (source, family, ntree, n).

Arguments

object

A fitted rhf object from randomForestRHF.

...

Further arguments passed to randomForestRHF::auct.rhf(), for example bootstrap.rep to request confidence bounds, or riskset for the incident definition. Ignored when auct_fit is supplied.

marker

Risk marker for the AUC: "chf" (cumulative hazard, default) or "haz" (hazard). Not used when auct_fit is supplied, though the value is still validated.

auct_fit

Optional precomputed randomForestRHF::auct.rhf() result (class "auct.rhf") for the same object. NULL (default) computes it. Supply it to reuse an expensive bootstrap run.

method

Which time-dependent AUC definition to compute, passed to randomForestRHF::auct.rhf(). "cumulative" (default) ranks accumulated risk through a horizon; "incident" ranks local failures within the risk set at each time. See the note below on choosing between them. Not used when auct_fit is supplied, though the value is still validated.

References

Ishwaran H, Hsich EM, Kogalur UB, Lee DKK (2026). Random Hazard Forests. arXiv:2608.21597. tools:::Rd_expr_doi("10.48550/arXiv.2608.21597").

Ishwaran H, Kogalur UB (2026). randomForestRHF: Random Hazard Forests. R package version 2.0.3. https://CRAN.R-project.org/package=randomForestRHF.

See Also

plot.gg_auct(), randomForestRHF::auct.rhf()

Examples

Run this code
# \donttest{
if (requireNamespace("randomForestRHF", quietly = TRUE)) {
  data(pbc, package = "randomForestSRC")
  d <- randomForestRHF::convert.counting(
    survival::Surv(days, status) ~ ., na.omit(pbc))
  o <- randomForestRHF::rhf("Surv(id, start, stop, event) ~ .", d, ntree = 30)
  plot(gg_auct(o, marker = "chf"))
}
# }

Run the code above in your browser using DataLab