effect_draw {baggr} | R Documentation |
This function takes the samples of hyperparameters from a baggr model (typically hypermean and hyper-SD, which you can see using treatment_effect) and draws values of new realisations of treatment effect, i.e. an additional draw from the "population of studies". This can be used for both prior and posterior draws, depending on baggr model.
effect_draw(x, n, transform = NULL, summary = FALSE, interval = 0.95)
x |
A |
n |
How many values to draw? The default is as long as the number of samples
in the |
transform |
a transformation (an R function) to apply to the result of a draw. |
summary |
logical; if TRUE returns summary statistics rather than samples from the distribution; |
interval |
uncertainty interval width (numeric between 0 and 1), if |
The predictive distribution can be used to "combine" heterogeneity between treatment effects and uncertainty in the mean treatment effect. This is useful both in understanding impact of heterogeneity (see Riley et al, 2011, for a simple introduction) and for study design e.g. as priors in analysis of future data (since the draws can be seen as an expected treatment effect in a hypothetical study).
The default number of samples is the same as what is returned by Stan model implemented in baggr,
(depending on such options as iter
, chains
, thin
). If n
is larger than what is available
in Stan model, we draw values with replacement. This is not recommended and warning is printed in
these cases.
Under default settings in baggr, a posterior predictive distribution is obtained. But
effect_draw
can also be used for prior predictive distributions when
setting ppd=T
in baggr. The two outputs work exactly the same way.
A vector (with n
values) for models with one treatment effect parameter,
a matrix (n
rows and same number of columns as number of parameters) otherwise.
Riley, Richard D., Julian P. T. Higgins, and Jonathan J. Deeks. "Interpretation of Random Effects Meta-Analyses". BMJ 342 (10 February 2011)..
treatment_effect returns samples of hypermean and hyper-SD which are used by this function