[R-meta] Effect size calculation: Hedges g average / dependent groups

Pia-Magdalena Schmidt p|@-m@gd@|en@@@chm|dt @end|ng |rom un|-bonn@de
Thu Dec 21 22:32:28 CET 2023


Dear all,

I would be very grateful if you could help me clarify my calculations.

I am conducting a meta-analysis using metafor and want to calculate Hedges g 
av (see Lakens, 2013 - doi: 10.3389/fpsyg.2013.00863).

[background: within-design with healthy participants investigating drug 
effects compared to placebo, repeated measures: 1x drug, 1x placebo (no pre- 
, post- treatment design); available data: m1i, m2i, sd1i, sd2i, n1i, n2i 
with n1i = n2i]

1. As I did not find a direct way to calculate Hedges g av in metafor, I 
calculated the sd (sd_average = (sd1i + sd2i)/2) manually and used “SMD1”, 
since this only requires one sd input and should otherwise be the same as 
“SMD”. Is that right?

2. To check my approach, I compared “SMD1” with sd2i = sd_pooled and 
compared the results to “SMD”. I expected identical effect sizes as I 
thought that “SMD1” with sd2i = sd_pooled should match “SMD”, but my 
calculations yielded different values for yi & vi.

An example of my code and results:

library(metafor)

# create minimal data
dat <- structure(list(id = c(1, 2, 3), n_drug = c(10, 20, 15), m_drug = 
c(435.4, 460, 404), sd_drug = c(60.2, 36.6, 58.09), n_plc = c(10, 20, 15), 
m_plc = c(493.7, 460, 474), sd_plc = c(89.9, 40.6, 44.93)), class = 
c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -3L))

sd_average <- 1/2*(dat$`sd_drug` + dat$`sd_plc`)
sd_pooled <- sqrt(((dat$`n_drug`-1)*dat$`sd_drug`^2 + 
(dat$`n_plc`-1)*dat$`sd_plc`^2) / (dat$`n_drug`+dat$`n_plc`-2))

# --- Relating Question 1 ---
# SMD1 with input sd_average
es_smd1average = escalc(measure="SMD1",
   n1i = dat$`n_drug`,
   n2i = dat$`n_plc`,
   m1i = dat$`m_drug`,
   m2i = dat$`m_plc`,
   sd2i= sd_average,
   vtype ="UB")

# --- Relating Question 2 ---
# SMD1 with input sd_pooled
es_smd1pooled= escalc(measure="SMD1",
   n1i=dat$`n_drug`,
   n2i =dat$`n_plc`,
   m1i = dat$`m_drug`,
   m2i = dat$`m_plc`,
   sd2i= sd_pooled,
   vtype ="UB")

# SMD
es_smd= escalc(measure="SMD",
   n1i=dat$`n_drug`,
   n2i =dat$`n_plc`,
   m1i = dat$`m_drug`,
   m2i = dat$`m_plc`,
   sd1i = dat$`sd_drug`,
   sd2i = dat$`sd_plc`,
   vtype ="UB")


> print(es_smd1pooled)

   yi vi
1 -0.6964 0.2333
2 0.0000 0.1000
3 -1.2743 0.1995

> print(es_smd)

   yi vi
1 -0.7298 0.2164
2 0.0000 0.1000
3 -1.3115 0.1661

I thought about using “SMCC” instead but ri, t-statistics and p-values are 
(often) unknown.

Do you have any comments?

Many thanks in advance!
Best,
Pia



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