Usage
## S3 method for class 'brmsfit':
marginal_effects(x, effects = NULL, conditions = NULL,
re_formula = NA, probs = c(0.025, 0.975), method = c("fitted",
"predict"), ...)
marginal_effects(x, ...)
## S3 method for class 'brmsMarginalEffects':
plot(x, ncol = NULL, points = FALSE,
rug = FALSE, theme = ggplot2::theme(), ask = TRUE, do_plot = TRUE,
...)
Arguments
x
An object usually of class brmsfit
effects
An optional character vector naming effects
(main effects or interactions) for which to compute marginal plots.
If NULL
(the default), plots for all effects are generated.
conditions
An optional data.frame
containing variable values
to marginalize on. Each effect defined in effects
will
be plotted separately for each row of data
.
The row names of data
will be treated as titles of
re_formula
A formula containing random effects to be considered
in the marginal predictions. If NULL
, include all random effects;
if NA
(default), include no random effects.
probs
The quantiles to be used in the computation of credible
intervals (defaults to 2.5 and 97.5 percent quantiles)
method
Either "fitted"
or "predict"
.
If "fitted"
, plot marginal predictions of the regression curve.
If "predict"
, plot marginal predictions of the responses.
ncol
Number of plots to display per column for each effect.
If NULL
(default), ncol
is computed internally based
on the number of rows of data
.
points
Logical; indicating whether the original data points
should be added via geom_point
.
Default is FALSE
. Note that only those data points will be added
that match the spec rug
Logical; indicating whether a rug representation of predictor
values should be added via geom_rug
.
Default is FALSE
. theme
A theme
object
modifying the appearance of the plots.
For some basic themes see ggtheme
.
Can be defined globally for the curr ask
logical; indicates if the user is prompted
before a new page is plotted.
Only used if do_plot
is TRUE
.
do_plot
logical; indicates if plots should be
plotted directly in the active graphic device.
Defaults to TRUE
.