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.
Usage
# S3 method for class 'pi_campsis_tbl'
vpc_plot(x, strata = "auto", level = 0.9, alpha = 0.15, facet = TRUE, ...)Arguments
- x
a
pi_campsis_tblobject with areplicatecolumn- strata
stratification for the VPC. One of
"auto",NULL, or a named character vector of length 1. See Details.- level
confidence interval level for the ribbons around each percentile. Default is
0.90(90% CI).- alpha
transparency of the ribbons. Default is
0.15.- facet
how the stratification variable is displayed when present.
TRUE(default) draws one panel per stratum;FALSEoverlays the strata in a single panel and maps the stratum to the ribbon fill colour. Forwarded tovpcPlot.- ...
additional arguments (currently unused, reserved for future use)
Details
Stratification is resolved as follows:
"auto"(default):ARMis used when more than one distinct arm is detected; otherwiseSCENARIOis used when more than one distinct scenario is detected; otherwiseNULL(no stratification). Only one stratification variable is applied becausevpcPlotsupports at most one.NULL: no stratification.named character vector: passed directly to
vpcPlot(e.g.c(ARM = "all")orc(SCENARIO = "all")).
