Skip to contents

Plot saved ALE estimates and intervals, without recomputing predictions.

Usage

# S3 method for class 'ale'
draw(
  object,
  ci = TRUE,
  ref_line = TRUE,
  alpha = 0.2,
  xlab = NULL,
  ylab = NULL,
  ...
)

Arguments

object

a tibble of class "ale", produced by ale().

ci

logical; show the saved interval ribbon?

ref_line

logical; draw a horizontal reference line at zero?

alpha

Deprecated; use gratia_theme_get() theme settings instead. Numeric; opacity of the interval ribbon.

xlab, ylab

optional axis labels. Defaults identify the focal covariate and selected parameter. The computation scale appears in the caption. Titles and subtitles are omitted. Use ggplot2::labs() to change or remove the caption, for example + ggplot2::labs(caption = NULL).

...

reserved for future use.

Value

A ggplot2::ggplot() object.

See also

Examples

library("mgcv")
df <- data_sim("eg1", n = 100, seed = 2)
m <- gam(y ~ s(x2), data = df, method = "REML")
ale(m, "x2") |> draw()