weightsplot {bayesmeta}  R Documentation 
Illustrate the posterior mean weights for a bayesmeta
object.
Description
Generates a bar plot showing individual estimates' posterior mean weights, either for the overall mean estimate, or for a shrinkage estimate.
Usage
weightsplot(x, ...)
## S3 method for class 'bayesmeta'
weightsplot(x, individual=FALSE, ordered=TRUE,
extramargin=4, priorlabel="prior mean", main, xlim, ...)
Arguments
x 
a 
individual 
this argument allows to request weights for individual
shrinkage estimates. If 
ordered 
a logical flag indicating whether to sort weights by their magnitude. 
extramargin 
an additional margin to be added to the left side of the plot, in
order to accomodate the estimates' labels. The value will be added
to the 2nd element of the margin settings given by
‘ 
priorlabel 
the label for the effect prior's weight. Only relevant for proper effect priors. 
main 
the plot's main title. 
xlim 
the xaxis range. 
... 
other arguments passed on to the

Details
The individual estimates' contributions to the overall mean estimate are commonly illustrated in terms of weights, as the resulting overall estimate may be expressed as a weighted average of the estimates contributing to the analysis. The notion of “study weights” may also be extended to the Bayesian setting, where these result as posterior mean weights. Analogous weights may also be derived for shrinkage estimates (Roever and Friede, 2021).
This function generates a simple bar plot illustrating the
posterior mean weights. The actual numbers are taken from the
bayesmeta
object's “$weights
” or
“$weights.theta
” elements.
Author(s)
Christian Roever christian.roever@med.unigoettingen.de
References
C. Roever, T. Friede. Bounds for the weight of external data in shrinkage estimation. Biometrical Journal, 65(5):11311143, 2021. doi:10.1002/bimj.202000227.
See Also
Examples
# load example data:
data("Peto1980")
## Not run:
# compute effect sizes (log odds ratios) from count data:
require("metafor")
peto.es < escalc(measure="OR",
ai=treat.events, n1i=treat.cases,
ci=control.events, n2i=control.cases,
slab=publication, data=Peto1980)
# perform metaanalysis:
ma01 < bayesmeta(peto.es)
# show data and results:
forestplot(ma01)
# check out weights:
ma01$weights
ma01$weights.theta
# illustrate weights:
weightsplot(ma01)
weightsplot(ma01, ordered=FALSE)
weightsplot(ma01, ordered=FALSE, individual="BrMedJ1974")
## End(Not run)