plot_RA_fits | R Documentation |
Plots the benchmark heterogeneity priors inducing the specified model fits fits.bm
and the corresponding marginal benchmark posteriors for different parameters in the
NNHM.
Also displays the actual heterogeneity priors inducing the specified actual model fits fits.actual
and the corresponding marginal posteriors.
All bayesmeta fits should be based on the same data set.
plot_RA_fits(fits.actual, fits.bm, type="pri.tau", xlim, ylim,
legend=FALSE, pos.legend="topright",
legend.tau.prior=c(), bty="o",
col.actual=c("red","lightpink3","darkgreen","green",
"violetred")[1:length(fits.actual)],
col.bm=c("cyan","black","blue","darkgray",
"dodgerblue")[1:length(fits.bm)],
lty.actual=rep(2, times=length(col.actual)),
lty.bm=rep(1, times=length(col.bm)),
lwd.actual=rep(2, times=length(col.actual)),
lwd.bm=rep(2, times=length(col.bm)))
fits.actual |
a list of model fits (max. 5 fits) of class bayesmeta, computed with
the |
fits.bm |
a list of model fits (max. 5 fits) of class bayesmeta, computed with
the |
type |
specifies if heterogeneity priors or marginal posterior densities for
a given parameter should be plotted.
Options are |
xlim |
a vector of two real numbers. Limits of the x-axis. (First number >= 0 for densities for tau.) |
ylim |
a vector of two real non-negative numbers. Limits of the y-axis. |
legend |
logical. Specifies if a legend should be added to the plot. Defaults to |
pos.legend |
a character string specifing the position of the legend in the plot.
Options are all the keywords accepted by
the |
legend.tau.prior |
a vector of character strings or expressions with one
entry for each fit in |
bty |
the type of box to be drawn around the legend. The allowed values are "o" (the default) and "n". |
col.actual |
vector of color specifications for the lines representing the actual fits in
|
col.bm |
vector of color specifications for the lines representing the benchmark fits in
|
lty.actual |
vector of line type specifications for the lines representing the actual fits in
|
lty.bm |
vector of line type specifications for the lines representing the benchmark fits in
|
lwd.actual |
numeric vector specifying the width of the lines representing the actual fits in
|
lwd.bm |
numeric vector specifying the width of the lines representing the benchmark fits in
|
Two alternative suggestions for posterior benchmarks are provided
in Ott et al. (2021, Section 3.4) and its Supplementary Material (Section 2.5) and they
can be computed using the functions fit_models_RA
and fit_models_RA_5bm
,
respectively.
No return value, produces graphical output only.
Ott, M., Plummer, M., Roos, M. (2021). How vague is vague? How informative is informative? Reference analysis for Bayesian meta-analysis. Statistics in Medicine 40, 4505–4521. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.9076")}
Ott, M., Plummer, M., Roos, M. (2021). Supplementary Material: How vague is vague? How informative is informative? Reference analysis for Bayesian meta-analysis. Statistics in Medicine. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.9076")}
bayesmeta
in the package bayesmeta,
fit_models_RA
, plot_RA
# for aurigular acupuncture (AA) data set with two
# actual half-normal and half-Cauchy heterogeneity priors
data(aa)
# compute the model fits
fits <- fit_models_RA(df=aa, tau.prior=list(function(t)dhalfnormal(t, scale=1),
function(t)dhalfcauchy(t, scale=1)))
# plot the HN0 benchmark prior (do not show the improper J benchmark)
fits.bm.pri <- fits[1]
# benchmark fits under HN0 and J priors
fits.bm.post <- fits[1:2]
fits.actual <- fits[3:4]
# prior densities
plot_RA_fits(fits.actual=fits.actual, fits.bm=fits.bm.pri,
type="pri.tau", xlim=c(0, 2), ylim=c(0, 3),
legend=TRUE,
legend.tau.prior=c("HN(1)", "HC(1)", "HN0"))
# marginal posterior for the effect mu
plot_RA_fits(fits.actual=fits.actual, fits.bm=fits.bm.post,
type="post.mu", xlim=c(-1.5, 1.5), ylim=c(0, 3),
legend=TRUE,
legend.tau.prior=c("HN(1)", "HC(1)",
"HN0", "J"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.