plot_RA_fits {ra4bayesmeta} | 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", "dogerblue")[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
|
Suggestions for prior and posterior benchmarks are provided
in Ott et al. (2020, Sections 2.5-2.7).
These benchmarks can be
computed using the function fit_models_RA
.
Ott, M., Plummer, M., Roos, M. How vague is vague? How informative is informative? Reference analysis for Bayesian meta-analysis. Manuscript submitted to Statistics in Medicine. 2020.
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)))[[1]] # benchmark fits under SGC(m_inf), SIGC(M_J), SGC(m_J) and SIGC(M_inf) priors fits.bm.pri <- fits[1:4] # benchmark fits under SGC(m_inf), Jeffreys' and SIGC(M_inf) priors fits.bm.post <- fits[c(1,5,4)] fits.actual <- fits[c(6,7)] # 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)", expression(SGC(m[infinity])), expression(SIGC(M[J])), expression(SGC(m[J])), expression(SIGC(M[infinity])))) # 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,2), ylim=c(0,3), legend=TRUE, legend.tau.prior=c("HN(1)", "HC(1)", expression(SGC(m[infinity])), "Jeffreys", expression(SIGC(M[infinity]))))