Skip to content

[R-meta] How to interpret sigma(model)^2 in metafor

5 messages · Wolfgang Viechtbauer, Yuhang Hu

#
Depends on what you mean by 'variance of the residuals'. With:

rstandard(res)$se^2

you can obtain the *sampling variance* of the residuals. Note that each residual has its own sampling variance.

If you just want the *sample variance* of the residuals, then

var(resid(res))

would give you that.

Best,
Wolfgang
#
Thank you, Wolfgang. I guess my expectation was that `rstandard(res)$se^2`
should be equal to `dat$vi` since the model takes `dat$vi` as given (known
and fixed) for the sampling distribution of each residual in each row (e_ij
~ Normal[0, dat$vi])?

Thank you very much,
Yuhang

On Wed, Jan 25, 2023 at 1:40 AM Viechtbauer, Wolfgang (NP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:

            

  
    
#
They are not quite the same. dat$vi are not the sampling variances of the residuals, but of the sampling errors. Those are indeed assumed to be known and fixed. However, the sampling variances of the residuals depend on the model you are fitting.

Best,
Wolfgang
#
Thank you, Wolfgang. I guess there is a gap in my understanding, then,
regarding the difference between sampling errors which I think for the
current model (i.e., yij = B0 + B1*yearij + uj + vij + eij) are defined as:

eij = yij - theta_ij (true effect_ij), with Var(eij) = dat$vi for each eij
~ Normal[0, dat$vi].

and residuals i.e., Var(yij - fitted(yij)) .

I thought that the variances of the sampling errors (i.e., dat$vi) which
indicate that effect sizes collected from the literature are estimated with
error eventually are the same as the Var(yij - fitted(yij)) thinking that
fitted(yij) is taken as theta_ij.

Best,
Yuhang

On Wed, Jan 25, 2023 at 9:48 AM Viechtbauer, Wolfgang (NP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:

            

  
    
1 day later
#
The residuals are not the same as the sampling errors. Yes, the sampling errors have variance v_ij, but the *observed residuals* have a different variance which depends on the model being fitted, since Var(y_ij - fitted_ij) = Var(y_ij) + Var(fitted_ij) - 2*Cov(yij,fitted_ij).

Best,
Wolfgang