[R-meta] Formula SD in metafor package
Viechtbauer, Wolfgang (SP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Thu Oct 14 14:51:16 CEST 2021
Dear Emmelie,
Please post in plain text. HTML emails can get wrangled up, as you can see below with some symbols not displaying correctly.
One of the nice things about open-source software is that you can always check the code yourself (well, at least if you can make sense of the spaghetti code I write ...). For example, the part you are asking about is here:
https://github.com/wviechtb/metafor/blob/master/R/escalc.r#L1787
And in particular the line:
sddi <- sqrt(sd1i^2 + sd2i^2 - 2*ri*sd1i*sd2i)
answers your question.
Best,
Wolfgang
>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Emmelie Simoens
>Sent: Thursday, 14 October, 2021 13:41
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] Formula SD in metafor package
>
>Dear all,
>
>We are doing a meta-analysis for a paired data design. Our effect size is a bit
>awkward because we are ultimately interested in a standardized paired mean
>difference of a standardized paired mean difference. To do this we will use the
>escalc function with the SMCC measure. Our function will be looking like this:
>
>escalc(measure = �SMCC�,
> m1i = meandifference1 � meandifference2,
> m2i = meandifference3 � meandifference4,
> sd1i = sqrt(SD1^2 + SD2^2 -
> 2*CorrelationMean12*SD1*SD2),
> sd2i = sqrt(SD3^2 + SD4^2 -
> 2* CorrelationMean34*SD3*SD4),
> ni = Samplesize ,
> ri = 0.3, #this will be a hypothesized measure
> data = Data)
>
>Now, our question is what formula uses the metafor package for calculating the
>pooled SD?
>Does it use the same formula as us: sqrt (SD1^2 + SD2^2 � 2 * r * SD1 * SD2) or
>the following SD-within formula: sqrt ( ( n1-1)*S^21 + (n2-1)*S^22 )/(n1 + n2 -
>2)? We just want to make sure that our inserted formulas are in line with the
>underlying computation.
>
>Many thanks,
>Emmelie
More information about the R-sig-meta-analysis
mailing list