blsmeta: Bayesian Meta-Analysis via (Mixed-Effects) Location-Scale...

Description Usage Arguments Details Value Note References Examples

View source: R/blsmeta.R

Description

Fit meta-analytic models, including fixed-effects, two-level, and three-level random-effects models. Moderators can be included for both the location and scale parameters. This is accomplished with mixed-effects location-scale modeling \insertCite@see for example @Hedeker2008blsmeta, with the basic idea extended to meta-analysis in \insertCitewilliams2021putting;textualblsmeta.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
blsmeta(
  yi,
  vi,
  sei,
  es_id,
  study_id,
  mods = ~1,
  mods_scale2 = ~1,
  mods_scale3 = ~1,
  prior = NULL,
  iter = 5000,
  warmup = 1000,
  chains = 4,
  log_linear = TRUE,
  data
)

Arguments

yi

vector with the observed effect sizes (length k).

vi

vector with the sampling variances (length k). Provide either vi or sei.

sei

vector with the sampling variances (length k). Provide either vi or sei.

es_id

numeric vector with the effect size ids (i.e., 1:k). When provided, a two-level random-effects model is estimated. Whereas, when not specified, a fixed-effects model is estimated by default.

study_id

numeric vector with the study ids (length k). When provided, a three-level random-effects model is estimated (es_id is required). Note that the yi's are assumed to be nested within study_id.

mods

an object of class formula, including moderator(s) for the effect size. By default, an intercept only model is fitted (i.e., mods = ~ 1), resulting in the overall effect.

mods_scale2

an object of class formula, including moderator(s) for level two variance component (or "scale"). By default, an intercept only model is fitted (i.e., mods = ~ 1), resulting in the customary estimate (assumed constant across studies).

mods_scale3

an object of class formula, including moderator(s) for level three variance component (or "scale"). By default, an intercept only model is fitted (i.e., mods = ~ 1), resulting in the customary estimate (assumed constant across studies). See Details.

prior

one or more blsmetaprior objects created by assign_prior.

iter

numeric. The number of posterior samples per chain (defaults to 5000, excluding warmup).

warmup

numeric. The number of warmup samples, which are discarded (defaults to 1000).

chains

numeric. The number of chains (defaults to 4)

log_linear

logical. Should the variance components be modeled on the log-scale (defaults to TRUE)? This is applicable to the scale models with no moderators. See Details.

data

data frame containing the variables in the model.

Details

"Scale"

The scale corresponds to the variance of a normal distribution. However, in blsmeta it is modeled on the standard deviation scale. As a result, the reported estimates are also on the standard deviation (log) scale. To make sense of the estimates, it is helpful to use the predict function.

log_linear

In the two and three-level models, by default a log-linear model is fitted to the random-effects variances ("scale"). When no moderators are included in mods_scale2 and mods_scale3, this is an intercept only model (the "scale" is constant across the k studies).

To use a different prior distribution (as opposed to the default log-normal), this can be changed by setting log_linear = FALSE. In this case, a half Student-t prior is employed which is then similar to the R package brms. Note that a log-linear model is required when moderators are included in mods_scale2 and mods_scale3.

mods_scale3

Moderators for mods_scale3 are inherently level 3 predictors. This means that the study-level characteristic cannot not vary within study. For example, with, say, 100 effect sizes from 25 studies, this variance component is predicted with only the 25 studies. To do so, the first row of every study is used by default.

Value

An object of class blsmeta. This is used internally, and it is not all that useful otherwise.

Note

Three-level meta-analyses are described in \insertCitevan2013three;textualblsmeta, \insertCitecheung2014modeling;textualblsmeta, and \insertCiteassink2016fitting;textualblsmeta.They allow for modeling dependent effect sizes (several from the same study).

References

\insertAllCited

Examples

1
2
3
4
5
6
7
8
9
# data
library(psymetadata)

  
fit <- blsmeta(yi = yi, vi = vi, 
               es_id = es_id, 
               data = gnambs2020, 
               chains = 2)
               

donaldRwilliams/blsmeta documentation built on Dec. 20, 2021, 12:12 a.m.