Skip to content
Prev 2988 / 5632 Next

[R-meta] Query model structure rma.mv

Dear Sybryn,

Please see below for my responses.

Best,
Wolfgang
Yes, you can use forest() in combination with rma.mv() objects. The function doesn't do anything special for 'rma.mv' objects, so it just shows the individual estimates (plus it adds the pooled estimate at the bottom if the model doesn't include any moderators). If you want to indicate some kind of grouping visually, you have to take some extra steps. See, for example, the last example at:

https://wviechtb.github.io/metafor/reference/forest.rma.html
Adding or changing the random effects structure impacts the weighting structure. This is to be expected.
I don't know what commands you ran, but if you looked at the ACF of the residuals within studies, then those will still be autocorrelated, even if the autocorrelation is accounted for in the model. Here is an example (not really a meta-analysis, so 'yi' are raw data, but this illustrates the principle and simplifies things since we don't have to worry about a nested structure of observations within studies):

############################

library(metafor)

sigma <- 0.5
rho   <- 0.6
n     <- 1000
time  <- 1:n
const <- rep(1, n)

yi <- arima.sim(model=list(ar=rho), n=n) * sqrt(1-rho^2) * sigma

# treat all observations as independent
res1 <- rma.mv(yi, 0, random = ~ 1 | time)
res1

# assume an AR1 structure for the observations
res2 <- rma.mv(yi, 0, random = ~ time | const, struct="AR")
res2

acf(resid(res1))
acf(resid(res2))

# both ACFs show the same autocorrelation in the residuals

############################

To 'get rid' of the autocorrelation in the residuals, one has to compute what are sometimes called 'normalized residuals' (see Pinheiro & Bates, 2000) or 'Choleksy residuals'. Continuing with the example:

acf(resid(res1, type="cholesky"))
acf(resid(res2, type="cholesky"))

The ACF for res2 shows no noteworthy autocorrelation.

For meta-analytic data, you would have to look at the residuals within studies. Also, there is the issue of how one should deal with any random effects that are 'higher' up in the hierarchy of your model, that is, when computing the residuals, should one compute them only around the fixed effects or should one remove/partial out the contributions of any additional random effects? This gets complicated quickly, so instead, I would just suggest to run a LRT comparing the two models:

anova(res1, res2)

This will tell you whether the model with the autocorrelation structure fits significantly better than the one without.