Model description
The Gaussian random-effects model is the standard Bayesian meta-analysis model. Study-level true effects are drawn from a normal distribution with mean and standard deviation . Observed effects are noisy realisations of .
Mathematical specification
Likelihood:
Random effects:
Priors:
Derived quantities:
Stan code
data {
int<lower=1> N;
int<lower=1> K;
vector[N] y;
vector<lower=0>[N] se;
array[N] int<lower=1> study;
}
parameters {
real mu;
real<lower=0> tau;
vector[K] z;
}
transformed parameters {
vector[K] u = tau * z;
}
model {
target += normal_lpdf(mu | 0, 1);
target += cauchy_lpdf(tau | 0, 0.5);
target += std_normal_lpdf(z);
target += normal_lpdf(y | mu + u[study], se);
}
generated quantities {
real b_Intercept = mu;
}How bayesma calls this model
This is the default for model_type = "random_effect" with re_dist = "normal". The Stan data list includes the study index array, mapping each row in the data to a study. For two-stage meta-analysis, each study contributes one row; . For one-stage models with multiple arms per study, .
The default prior on is Half-Cauchy(0, 0.5). This places substantial prior mass below while allowing larger values. It can be changed with tau_prior:
bayesma(data, model_type = "random_effect", tau_prior = half_normal(0, 0.25))Non-centred parameterisation
The z parameterisation separates from the shape of the random effects. When is near zero, the centred parameterisation (using u directly) creates a funnel-shaped posterior where the must all approach zero together as . The NCP avoids this by sampling on a fixed scale.
Identifiability and small- behaviour
When , is weakly identified. The posterior for reflects the prior more heavily. In this case:
- Report the sensitivity of conclusions to the prior.
- Consider using a more informative prior from an external source (e.g., Turner et al. 2015).
- The posterior mean of is still a valid estimator, but its credible interval may be misleading.
Known sampling difficulties
The funnel-shaped posterior near can cause divergent transitions in the centred parameterisation. The NCP (used by default) resolves this in most cases. If divergences persist:
- Increase
adapt_deltato 0.99. - Place a more informative prior on (e.g.,
half_normal(0, 0.5)instead ofhalf_cauchy(0, 0.5)).
