This function has been renamed. Please use add_error_envelope instead.

add_model_predictions(
  x,
  CI = list(),
  fCI = "poly",
  CI_gp = list(col = scales::alpha("lightgrey", 0.8), border = FALSE),
  add_fitted = TRUE,
  fitted_gp = list(col = "black", lwd = 1, lty = 1)
)

Arguments

x

A numeric vector defining the x values at which fitted values/CIs will be plotted.

CI

A named list with fitted values (optional) and lower and upper CIs (i.e. CI$fit, CI$lowerCI, CI$upperCI). This can be created by list_CIs.

fCI

A character defining the method by which CIs will be added to a plot: as lines ("lines") or as a shaded polygon ("poly"). For large datasets, fCI = "lines" is much faster.

CI_gp

A named list of graphical parameters for CIs. If fCI = "lines", then two nested lists can be included to specify the lower and upper CI lines differently, if desired (see Examples).

add_fitted

A logical input defining whether or not add the fitted line.

fitted_gp

A named list of graphical parameters for the fitted line (passed to lines).

Value

The function adds model predictions to a plot.

Details

The function is designed for continuous explanatory variables (i.e., adding regression lines and CIs to a plot). See add_error_bars for discrete explanatory variables.

Author

Edward Lavender