Function for fitting random-effects, meta-regression, multilevel, and location-scale meta-analytic models directly to either binary or count data.
brma.glmm(
ai,
bi,
ci,
di,
n1i,
n2i,
x1i,
x2i,
t1i,
t2i,
weights,
mods,
scale,
cluster,
data,
slab,
subset,
measure = "OR",
prior_effect,
prior_heterogeneity,
prior_mods,
prior_scale,
prior_heterogeneity_allocation,
prior_baserate,
prior_lograte,
standardize_continuous_predictors = TRUE,
set_contrast_factor_predictors = "treatment",
prior_unit_information_sd,
rescale_priors = 1,
prior_informed_field,
prior_informed_subfield,
sample = 5000,
burnin = 2000,
adapt = 500,
chains = 3,
thin = 1,
parallel = FALSE,
autofit = FALSE,
autofit_control = set_autofit_control(),
convergence_checks = set_convergence_checks(),
seed = NULL,
silent,
...
)A fitted object of class c("brma.glmm", "brma"). The object
contains checked data, checked priors, the JAGS fit, cached summary,
and cached coefficients. If the corresponding package options are enabled,
it can also contain cached LOO, WAIC, or marginal likelihood results.
a vector of the number of events in the treatment or experimental group for binomial GLMM models.
a vector of the number of non-events in the treatment or experimental group for binomial GLMM models.
a vector of the number of events in the control group for binomial GLMM models.
a vector of the number of non-events in the control group for binomial GLMM models.
a vector of the sample size in the treatment or experimental
group. If omitted for binomial GLMMs, it is computed as ai + bi.
a vector of the sample size in the control group. If omitted for
binomial GLMMs, it is computed as ci + di.
a vector of the number of events in the treatment/experimental group (for Poisson data).
a vector of the number of events in the control group (for Poisson data).
a vector of the person-time in the treatment/experimental group.
a vector of the person-time in the control group.
an optional vector of positive likelihood weights. For normal/effect-size models, each weight powers the estimate likelihood. For constructors with GLMM raw-count input, each weight powers the paired two-arm likelihood for one study.
an optional matrix, data.frame, or formula specifying
location moderators (meta-regressors). Formula input is evaluated in data.
an optional matrix, data.frame, or formula specifying
scale predictors for location-scale models. Formula input is evaluated in
data.
an optional vector of cluster identifiers for multilevel meta-analysis.
an optional data frame containing the variables.
an optional vector of study labels.
an optional logical or numeric vector specifying a subset of data to be used.
a character string specifying the effect size measure.
Normal/effect-size constructors require an explicit value and support
"SMD", "ZCOR", "RR", "OR", "HR", "RD", "IRR", and "GEN".
Use "GEN" only for general effect sizes without a known unit information
standard deviation. GLMM raw-count constructors support only "OR" and
"IRR" and default to "OR".
prior distribution for the effect size (\(\mu\)) parameter
(the intercept). If omitted, a default prior is constructed. In single-model
functions, explicit NULL or FALSE sets a spike at zero.
prior distribution for the heterogeneity (\(\tau\))
parameter. If omitted, a default prior is constructed. In single-model
functions, explicit NULL or FALSE sets a spike at zero.
prior distribution for the moderators (\(\beta\)) parameters.
A single prior applies to all terms; a named list can specify term-specific
priors. If omitted or NULL, default priors are used.
prior distribution for the scale (\(\delta\)) parameters.
A single prior applies to all terms; a named list can specify term-specific
priors. If omitted or NULL, default priors are used.
prior distribution for the fraction of
heterogeneity allocated to the cluster-level component in multilevel models
(\(\rho\)). If omitted or NULL, defaults to Beta(1, 1).
prior distribution for the estimate-specific midpoint
base-rate probability in binomial GLMM models. If omitted or NULL, defaults
to independent Beta(1, 1) priors.
prior distribution for the estimate-specific midpoint
log-rate in Poisson GLMM models. If omitted or NULL, a data-based
unit-information normal prior is used independently for each estimate.
logical. Whether to standardize continuous predictors.
Defaults to TRUE.
character. How to set contrast for factor predictors.
Defaults are constructor-specific and shown in each function usage; single-model
constructors use "treatment", while model-averaging constructors use "meandif".
numeric. The unit information standard deviation (\(\sigma_{unit}\)).
Cannot be used together with prior_informed_field.
numeric. A scaling factor for supported prior distributions.
Point and none priors are unchanged. For constructors with publication-bias
prior distributions, rescale_priors does not rescale them except for the
default PEESE prior's UISD adjustment. Defaults to 1.
character. The field of the informed prior distributions.
Omit to use the standard default prior specification; explicit NULL is invalid.
character. The subfield of the informed prior distributions.
Omit to use the field-specific default, such as "Cochrane" for
prior_informed_field = "medicine"; explicit NULL is invalid.
numeric. Number of MCMC samples to save. Defaults to 5000.
numeric. Number of burn-in iterations. Defaults to 2000.
numeric. Number of adaptation iterations. Defaults to 500.
numeric. Number of MCMC chains. Defaults to 3.
numeric. Thinning interval. Defaults to 1.
logical. Whether to run MCMC chains in parallel. Defaults to FALSE.
logical. Whether to automatically extend the MCMC chains if convergence is not met.
Defaults to FALSE.
list of autofit control settings. See set_autofit_control() for details.
list of convergence check settings. See set_convergence_checks() for details.
numeric. Random seed for reproducibility. Defaults to NULL.
logical. Whether to suppress output. Constructors with no
explicit default use RoBMA.get_option("silent") when silent is omitted.
Model-averaging wrappers default to TRUE unless explicitly changed.
additional advanced arguments. Fitting functions reject unused
arguments; currently recognized internal arguments include only_data,
only_priors, is_JASP, and is_JASP_prefix.
Model for odds ratios (measure = "OR") corresponds to Model 4 described in
jackson2018comparison;textualRoBMA.
logit(pi[i]) is the study-specific midpoint of the two arm logits.
prior_baserate defines the estimate-specific prior distribution on pi[i].
Model for incidence rate ratios (measure = "IRR") corresponds to
bagos2009mixed;textualRoBMA.
phi[i] is the study-specific midpoint of the two arm log incidence rates.
prior_lograte defines the estimate-specific prior distribution on phi[i].
If unspecified, a unit-information prior is based on the data and used
independently for each estimate.
When weights are supplied, they are treated as likelihood weights on the
paired two-arm study contribution.
brma(), BMA.glmm(), summary.brma(), predict.brma()
if (FALSE) {
if (requireNamespace("metadat", quietly = TRUE)) {
data(dat.bcg, package = "metadat")
fit <- brma.glmm(
ai = tpos,
bi = tneg,
ci = cpos,
di = cneg,
mods = ~ alloc,
data = dat.bcg,
measure = "OR",
seed = 1,
silent = TRUE
)
summary(fit)
}
}
Run the code above in your browser using DataLab