- x
An object of class brmsfit
.
- effects
An optional character vector naming effects (main effects or
interactions) for which to compute conditional plots. Interactions are
specified by a :
between variable names. If NULL
(the
default), plots are generated for all main effects and two-way interactions
estimated in the model. When specifying effects
manually, all
two-way interactions (including grouping variables) may be plotted
even if not originally modeled.
- conditions
An optional data.frame
containing variable values
to condition on. Each effect defined in effects
will
be plotted separately for each row of conditions
. Values in the
cond__
column will be used as titles of the subplots. If cond__
is not given, the row names will be used for this purpose instead.
It is recommended to only define a few rows in order to keep the plots clear.
See make_conditions
for an easy way to define conditions.
If NULL
(the default), numeric variables will be conditionalized by
using their means and factors will get their first level assigned.
NA
values within factors are interpreted as if all dummy
variables of this factor are zero. This allows, for instance, to make
predictions of the grand mean when using sum coding.
- int_conditions
An optional named list
whose elements are
vectors of values of the variables specified in effects
.
At these values, predictions are evaluated. The names of
int_conditions
have to match the variable names exactly.
Additionally, the elements of the vectors may be named themselves,
in which case their names appear as labels for the conditions in the plots.
Instead of vectors, functions returning vectors may be passed and are
applied on the original values of the corresponding variable.
If NULL
(the default), predictions are evaluated at the
\(mean\) and at \(mean +/- sd\) for numeric predictors and at
all categories for factor-like predictors.
- re_formula
A formula containing group-level effects to be considered
in the conditional predictions. If NULL
, include all group-level
effects; if NA
(default), include no group-level effects.
- prob
A value between 0 and 1 indicating the desired probability
to be covered by the uncertainty intervals. The default is 0.95.
- robust
If TRUE
(the default) the median is used as the
measure of central tendency. If FALSE
the mean is used instead.
- method
Method used to obtain predictions. Can be set to
"posterior_epred"
(the default), "posterior_predict"
,
or "posterior_linpred"
. For more details, see the respective
function documentations.
- spaghetti
Logical. Indicates if predictions should
be visualized via spaghetti plots. Only applied for numeric
predictors. If TRUE
, it is recommended
to set argument ndraws
to a relatively small value
(e.g., 100
) in order to reduce computation time.
- surface
Logical. Indicates if interactions or
two-dimensional smooths should be visualized as a surface.
Defaults to FALSE
. The surface type can be controlled
via argument stype
of the related plotting method.
- categorical
Logical. Indicates if effects of categorical
or ordinal models should be shown in terms of probabilities
of response categories. Defaults to FALSE
.
- ordinal
(Deprecated) Please use argument categorical
.
Logical. Indicates if effects in ordinal models
should be visualized as a raster with the response categories
on the y-axis. Defaults to FALSE
.
- transform
A function or a character string naming
a function to be applied on the predicted responses
before summary statistics are computed. Only allowed
if method = "posterior_predict"
.
- resolution
Number of support points used to generate
the plots. Higher resolution leads to smoother plots.
Defaults to 100
. If surface
is TRUE
,
this implies 10000
support points for interaction terms,
so it might be necessary to reduce resolution
when only few RAM is available.
- select_points
Positive number.
Only relevant if points
or rug
are set to TRUE
:
Actual data points of numeric variables that
are too far away from the values specified in conditions
can be excluded from the plot. Values are scaled into
the unit interval and then points more than select_points
from the values in conditions
are excluded.
By default, all points are used.
- too_far
Positive number.
For surface plots only: Grid points that are too
far away from the actual data points can be excluded from the plot.
too_far
determines what is too far. The grid is scaled into
the unit square and then grid points more than too_far
from the predictor variables are excluded. By default, all
grid points are used. Ignored for non-surface plots.
- probs
(Deprecated) The quantiles to be used in the computation of
uncertainty intervals. Please use argument prob
instead.
- ...
Further arguments such as draw_ids
or ndraws
passed to posterior_predict
or posterior_epred
.
- 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 conditions
.
- points
Logical. Indicates if the original data points should be added
via geom_jitter
. Default is FALSE
. Can be controlled
globally via the brms.plot_points
option. Note that only those data
points will be added that match the specified conditions defined in
conditions
. For categorical predictors, the conditions have to match
exactly. For numeric predictors, argument select_points
is used to
determine, which points do match a condition.
- rug
Logical. Indicates if a rug representation of predictor values
should be added via geom_rug
. Default is FALSE
.
Depends on select_points
in the same way as points
does. Can
be controlled globally via the brms.plot_rug
option.
- mean
Logical. Only relevant for spaghetti plots.
If TRUE
(the default), display the mean regression
line on top of the regression lines for each sample.
- jitter_width
Only used if points = TRUE
:
Amount of horizontal jittering of the data points.
Mainly useful for ordinal models. Defaults to 0
that
is no jittering.
- stype
Indicates how surface plots should be displayed.
Either "contour"
or "raster"
.
- line_args
Only used in plots of continuous predictors:
A named list of arguments passed to
geom_smooth
.
- cat_args
Only used in plots of categorical predictors:
A named list of arguments passed to
geom_point
.
- errorbar_args
Only used in plots of categorical predictors:
A named list of arguments passed to
geom_errorbar
.
- surface_args
Only used in surface plots:
A named list of arguments passed to
geom_contour
or
geom_raster
(depending on argument stype
).
- spaghetti_args
Only used in spaghetti plots:
A named list of arguments passed to
geom_smooth
.
- point_args
Only used if points = TRUE
:
A named list of arguments passed to
geom_jitter
.
- rug_args
Only used if rug = TRUE
:
A named list of arguments passed to
geom_rug
.
- facet_args
Only used if if multiple condtions are provided:
A named list of arguments passed to
facet_wrap
.
- theme
A theme
object
modifying the appearance of the plots.
For some basic themes see ggtheme
and theme_default
.
- ask
Logical; indicates if the user is prompted
before a new page is plotted.
Only used if plot
is TRUE
.
- plot
Logical; indicates if plots should be
plotted directly in the active graphic device.
Defaults to TRUE
.