Generates marginal fixed effects plots of one or more covariates from a ubmsFit submodel. For each plot, the focal covariate is allowed to vary across its range (or possible discrete values, for a factor), while the other covariates are held at their medians or reference levels. Random effects are ignored.

# S4 method for ubmsFit
plot_effects(
  object,
  submodel,
  covariate = NULL,
  level = 0.95,
  draws = 1000,
  smooth = NULL,
  ...
)

# S4 method for ubmsFit
plot_marginal(
  object,
  submodel,
  covariate = NULL,
  level = 0.95,
  draws = 1000,
  smooth = NULL,
  ...
)

Arguments

object

A fitted model of class ubmsFit

submodel

Submodel to get plots for, for example "det"

covariate

Plot a specific covariate; provide the name as a string

level

Probability mass to include in the uncertainty interval

draws

Number of draws from the posterior to use when generating the plots. If fewer than draws are available, they are all used

smooth

Smoother span (f) value used for LOWESS smoothing of the upper and lower credible interval bounds for a continuous covariate. No smoothing is done if NULL. A reasonable value to try is 0.05. The larger the value, the smoother the curve. As with all smoothing, use with caution

...

Currently ignored

Value

A ggplot if a single covariate is plotted, or an object of class grob if there are multiple covariates/panels