Raw residuals (type = "outcome") are computed as:
$$e_i = y_i - \hat{\mu}_i$$
where \(y_i\) is the observed effect size and \(\hat{\mu}_i\) is the
fitted value (prediction from the fixed effects).
Pearson residuals (type = "pearson") divide raw residuals by the
marginal standard error:
$$r_i^{Pearson} = \frac{e_i}{\sqrt{v_i + \tau^2}}$$
where \(v_i\) is the sampling variance and \(\tau^2\) is the
relevant heterogeneity component. Only available for normal outcome models
without selection (weightfunction) bias adjustment.
Standardized residuals (type = "rstandard") use the hat matrix to
compute residual standard errors that account for the uncertainty in
estimated coefficients:
$$z_i = \frac{e_i}{\sqrt{[(I-H)M(I-H)']_{ii}}}$$
where \(H\) is the hat matrix and \(M\) is the marginal variance-covariance
matrix. For models without moderators, this simplifies to the Pearson formula.
Only available for normal outcome models without selection (weightfunction)
bias adjustment.
LOO-PIT residuals (type = "LOO-PIT") are the Bayesian equivalent of
studentized deleted residuals vehtari2017practicalRoBMA. They
are computed via leave-one-out probability integral transformation:
$$r_i = \Phi^{-1}(u_i)$$
where \(u_i = \sum_s w_{is} F(y_i | \theta^{(s)})\) is the LOO-weighted CDF
value, \(w_{is}\) are the normalized PSIS weights, and \(F\) is the
cumulative distribution function of the estimate-unit predictive
distribution used by LOO. Under a correctly specified model, LOO-PIT
residuals should follow a standard normal distribution. Unlike traditional
standardized residuals, LOO-PIT residuals properly account for estimation
uncertainty and leverage without requiring a hat matrix. This is the
recommended method for standardized residuals in Bayesian meta-analysis.
For meta-regression models, fitted values incorporate moderator effects.
For models without moderators, all fitted values equal the pooled effect.
For GLMM models (binomial or Poisson), observed effect sizes and their
sampling variances are computed from the raw frequency data using the
same formulas as metafor::escalc with the default zero-cell
adjustment (adding 0.5 to all cells when any cell is zero). GLMM residuals
and LOO-PIT values are therefore approximate effect-size-scale diagnostics,
not exact PIT diagnostics for the raw count likelihood.
The residuals are computed separately for each posterior sample,
naturally propagating uncertainty in model parameters to the residuals.