Learn R Programming

ggRandomForests (version 4.0.0)

plot.gg_auct: Plot a time-varying AUC curve

Description

Draws AUC(t) from a gg_auct() object: a line over time, a bootstrap confidence ribbon when available, and a dashed reference line at 0.5 (chance). The integrated AUC (iAUC) appears in the caption. Times with a non-finite AUC are dropped before drawing: from randomForestRHF 2.0.0 the final grid time can be NA, where the censoring-weight denominator is undefined once the control set is nearly exhausted.

Usage

# S3 method for gg_auct
plot(x, ...)

Value

A ggplot object.

Arguments

x

A gg_auct object from gg_auct().

...

Not currently used.

See Also

gg_auct().

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))
}
# }

Run the code above in your browser using DataLab