plot.lago_sensitivity: Plot a LAGO sensitivity analysis

View source: R/lago_sensitivity.R

plot.lago_sensitivityR Documentation

Plot a LAGO sensitivity analysis

Description

Draws the sensitivity curve with ggplot2. By default (show = "cost") it plots the recommended cost against the swept value as a line with points: for an "outcome_goal" sweep this is the cost-of-stringency curve, and for a "cost_multiplier" sweep it is a straight line. With show = "components" it instead plots the recommended value of each intervention component against the swept value, one coloured line per component. Rows with NA outputs are dropped with a message. The runs whose goal could not be reached, so the shrinking method gave their recommendation, are drawn as triangles, and a caption says so. A sweep of period labels or dates is drawn on a discrete axis, in the order of values.

Usage

## S3 method for class 'lago_sensitivity'
plot(x, show = c("cost", "components"), ...)

Arguments

x

A "lago_sensitivity" object from lago_sensitivity().

show

One of "cost" (default, plot rec_int_cost) or "components" (plot the per-component recommended values).

...

Ignored.

Value

A ggplot2 object, or NULL invisibly when show = "components" and no components are recorded.

Examples


sens <- lago_sensitivity(
  data = mtcars, outcome_name = "mpg", outcome_type = "continuous",
  glm_family = "gaussian", link = "identity",
  intervention_components = c("gear", "qsec"),
  intervention_lower_bounds = c(0, 0),
  intervention_upper_bounds = c(10, 350),
  cost_list_of_vectors = list(c(0, 4), c(4, 6)),
  outcome_goal_intention = "maximize",
  parameter = "outcome_goal", values = c(30, 35, 40)
)
plot(sens)
plot(sens, show = "components")



LAGOtrials documentation built on Dec. 4, 2026, 5:10 p.m.