Plots estimated marginal means stored in a
marginal_means.brma object using BayesTools::plot_marginal().
Usage
# S3 method for class 'marginal_means.brma'
plot(
x,
parameter,
type = NULL,
prior = FALSE,
plot_type = "base",
dots_prior = NULL,
output_measure = NULL,
transform = NULL,
density_method = NULL,
density_control = NULL,
add = FALSE,
...
)
# S3 method for class 'marginal_means.brma'
lines(x, parameter, prior = FALSE, ...)Arguments
- x
a
marginal_means.brmaobject.- parameter
moderator term to plot. Use the original term name, for example
"measure","intercept"for the intercept when available,"mu"as an intercept alias, or the internal parameter name, for example"mu_measure".- type
for RoBMA product-space objects, whether to plot model-averaged (
"averaged") or conditional ("conditional") marginal means. Defaults to"averaged"and is available only for RoBMA marginal means.- prior
whether the marginal prior distribution should be added to the plot. Defaults to
FALSE.- plot_type
whether to use base R graphics (
"base") or ggplot2 ("ggplot"). Defaults to"base".- dots_prior
list of additional graphical arguments passed to the prior plotting function.
- output_measure
effect-size measure for location/effect predictions. Defaults to the fitted measure. Supported conversions are among
"SMD","COR","ZCOR", and"OR";"RR","HR","IRR","RD", and"GEN"can only be returned on their fitted measure. Usetransform = "EXP"for ratio-scale output from log-scale measures.- transform
optional display transformation. Currently
"EXP"exponentiates log-scale measures"OR","RR","HR", and"IRR".- density_method
posterior density method. The default
NULLreuses the method stored onx; specify"KDE"to override a stored qCMDE/IWMDE method."qCMDE"and"IWMDE"compute any missing densities for the plotted marginal means before plotting and never silently mix with KDE. Plot-time qCMDE/IWMDE computation can be slow and is used only for the current plot call; precompute withmarginal_means(..., density_method = "qCMDE")ormarginal_means(..., density_method = "IWMDE")to reuse densities across plots. Prefer qCMDE for likelihood-aware final results; IWMDE can be faster but is more sensitive to its fitted conditional weights. A qCMDE/IWMDE calculation for selected weightfunction models near zero cumulative ordered effects can take more than 10 minutes. A qCMDE/IWMDE request that the source model does not support stops before any density is estimated with an error of classRoBMA_density_method_unavailableand the class naming its cause (seemarginal_means.brma()).- density_control
named list of qCMDE/IWMDE density-estimation settings. Supported entries are
n_points(default100),samples(default500for qCMDE and1000for IWMDE density curves),target_relative_mcse(default0.05),display_grid(default"adaptive"),normalization_points(defaultNULL, resolved tomax(50, n_points)), andnormalization_prob(default0.999; seehypothesis()for the per-row truncation it permits).integration_control(defaultNULL) acceptsset_selection_likelihood_control()settings for Gaussian selection models; seemarginal_means.brma()for an example. The fitted object and posterior draws are unchanged.samplescontrols the fixed posterior-row budget for the density curve.target_relative_mcseis a point-ordinate diagnostic target and does not alter this fixed-budget plot. Curve diagnostics use the empirical 5–95 percent bulk, report the 5 and 95 percent tail checkpoints, and retain a whole-curve absolute MCSE safeguard relative to the density peak. Supplyingdensity_controlforces recomputation for the plotted marginal means instead of reusing stored densities. Increase row and normalization budgets when diagnostics report concentrated contributions or unstable normalization.- add
whether to add the densities to an existing plot. This is used by
lines.marginal_means.brma()and defaults toFALSE.- ...
additional graphical arguments passed to
BayesTools::plot_marginal().