[R-meta] Meta analysis on means and standard deviation

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Tue Oct 22 22:41:55 CEST 2019

Dear Manon,

Again, if 'variance' is just the variance of the raw measurements, then rma.uni(yi = M, vi = variance, ...) is incorrect. The 'vi' argument is for supplying the sampling variances of the outcome measure (the square of the standard errors) and for means, the sampling variance is 'variance / sample size':


Also, any particular reason why you are setting the 'weights' argument?

With respect to your questions:

1) table$se*sqrt(table$QE) makes no sense. If you want to know what the estimated variance of the true means is, then table$tau2 gives you that.

2) In principle yes (assuming you correctly compute the sampling variances of the variances), but variances have a rather skewed sampling distribution. A better approach is to analyze the log-transformed standard deviations. See also:


and search for "SDLN" and:

Nakagawa, S., Poulin, R., Mengersen, K., Reinhold, K., Engqvist, L., Lagisz, M., & Senior, A. M. (2015). Meta-analysis of variation: Ecological and evolutionary applications and beyond. Methods in Ecology and Evolution, 6, 143-152.


-----Original Message-----
From: manonbergerat using gmail.com [mailto:manonbergerat using gmail.com] 
Sent: Tuesday, 22 October, 2019 18:54
To: Viechtbauer, Wolfgang (SP)
Cc: r-sig-meta-analysis using r-project.org; Michael Dewey
Subject: Re: [R-meta] Meta analysis on means and standard deviation

Thank you very much already for your quick answer. 

To clarify our question, we want to study 2 outcomes : the mean and the standard deviation. 
In the data frame table, we have the variance of the raw measurements. 

1: Regarding the mean, we obtained a mean of our means (and its Standard error) thanks to the function rma.uni
meta_mean = rma.uni(yi = M, vi = variance, weights = 1/variance, method="REML", data=table). 

To obtain the standard deviation of the meta_mean, is it correct to use this code ? : 
meta_meanSD  = table$se*sqrt(table$QE)

2: Regarding the variance of the raw measurements, is it correct to use this function to obtain the value of variance ? 
meta_SD = rma.uni(yi = variance,  vi = « variance-of-variance », weights = 1/« variance-of-variance », method="REML", data=table)

Thank you again. 



Le 22 oct. 2019 à 15:37, Michael Dewey <lists using dewey.myzen.co.uk> a écrit :

Dear Manon

You might want to swap to emmeans as lsmeans is deprecated. According to one of the vignettes for emmeans there is no support for objects of class rma. However this is R so you could always try it and see what happens. You are not going to break anything.


On 22/10/2019 13:40, Viechtbauer, Wolfgang (SP) wrote:

Dear Manon,
Just to check: Is 'variance' in data frame 'table' the variance of the raw measurements or is it the variance of the means? It should be the latter (if 'variance' is the variance of the measurements, then the variance of the means is 'variance / n', where 'n' is the sample size).
1) I don't know what you mean by 'adjusted variance'. Variance of what? The variance of the 'adjusted mean'? If so, how did you compute the 'adjusted mean'?
2) With anova(meta, btt = 2:4) you would be testing coefficients 2, 3, and 4 simultaneously. If those coefficients correspond to the 'year' factor, then yes, this is the correct way to do this. And yes, if 'age' is included in the model, then this test is 'adjusted' for 'age'.
3) I don't know - haven't tried.
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of manonbergerat using gmail.com
Sent: Tuesday, 22 October, 2019 13:54
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] Meta analysis on means and standard deviation
Dear Meta-analysis community,
We are performing a meta-analysis on means and we have some questions about the package metafor.
Our dataset includes means, standard deviations, the year of measure, and the age of our population.
The code for our meta regression is :
meta= rma.uni(yi = M, vi = variance, weights = 1/variance, method="REML", mods=~1+Year+Age, data=table)
1: We would like to estimate an adjusted pooled variance.
For the moment, we have succeed to obtain an adjusted pooled mean. But for the variance, can we take into account the value in the variance-covariance matrix (« vb ») as a result of an adjusted pooled variance?
2: We categorized the variable « year » and we would like to have a global p-value of this categorized value.
Is the function in « Anova » anova(meta, btt = 2:4) correct to obtain this global p-value?
And is it adjusted related to our other variable « age » ?
Is it possible to have a p-value for trend?
3: Is the « lsmeans »  package compatible with metafor?
Thank you in advance.
Best regards.
Manon Bergerat

More information about the R-sig-meta-analysis mailing list