Plots VPC ribbons (a confidence interval around the median, lower and upper
percentiles) from a pi_campsis_tbl, i.e. the output of
simulate() with multiple replicates and a PIOutfun.
Such data already contains the per-replicate prediction interval in long
format (columns replicate, TIME, metric with values
"low" / "med" / "up" and value). This method
only needs to compute the confidence interval around each percentile across
replicates.
# S3 method for pi_campsis_tbl
vpc_plot(x, strata = "auto", level = 0.9, alpha = 0.15, facet = TRUE, ...)a ggplot object
a pi_campsis_tbl object with a replicate column
stratification for the VPC. One of "auto",
NULL, or a named character vector of length 1. See Details.
confidence interval level for the ribbons around each
percentile. Default is 0.90 (90% CI).
transparency of the ribbons. Default is 0.15.
how the stratification variable is displayed when present.
TRUE (default) draws one panel per stratum; FALSE overlays
the strata in a single panel and maps the stratum to the ribbon fill
colour. Forwarded to vpcPlot.
additional arguments (currently unused, reserved for future use)
Stratification is resolved as follows:
"auto" (default): ARM is used when more than one
distinct arm is detected; otherwise SCENARIO is used when
more than one distinct scenario is detected; otherwise NULL
(no stratification). Only one stratification variable is applied
because vpcPlot supports at most one.
NULL: no stratification.
named character vector: passed directly to vpcPlot
(e.g. c(ARM = "all") or c(SCENARIO = "all")).
vpcPlot, PIOutfun