Skip to content
Prev 4463 / 5636 Next

[R-meta] Computing Effect Size for Difference in Differences with Different Populations

Hey Wolfgang,

Thank you very much for the reply.

My mistake with the sd1i argument, I wasn't supposed to be using the post
sds. Thank you for pointing that out.

In my data the pre-treatment SDs are not similar (neither are the
pre-treatment means) between the groups. That is why I am a bit unsure
regarding the most appropriate ES computation method. I have mostly
meta-analysed RCT data in which the two groups are almost identical at
pre-treatment. I could not really find examples in which the difference in
treatment response is being compared between two different populations
receiving the same treatment.

In any case, the following is an okay representation of the actual data and
depending on which ES computation approach I use, the result looks quite
different. So, I was wondering if you could help me in deciding which of
the two is more appropriate or perhaps there is a third option. The data
(or a subsection of it) can also be meta-analysed with raw effect sizes
which does lead to different conclusions as well compared to the SMCRH/SMCC
approach).

Thank you very much in advance,
Mika

### dataset
set.seed(123)
n_G1 <- rpois(50, lambda = 50)
n_G2 <- n_G1

postm_G1 <- rnorm(50, mean = 14, sd = 2.5)
prem_G1 <- rnorm(50, mean = 10, sd = 2)
postsd_G1 <- rnorm(50, mean = 2.4, sd = 0.4)
presd_G1 <- rnorm(50, mean = 1.9, sd = 0.3)

postm_G2 <- rnorm(50, mean = postm_G1 - 7.5, sd = 1.8)
prem_G2 <- rnorm(50, mean = prem_G1 - 5, sd = 1.2)
postsd_G2 <- rnorm(50, mean = 1.2, sd = 0.2)
presd_G2 <- rnorm(50, mean = 1, sd = 0.2)

G <- data.frame(prem_G1,presd_G1, postm_G1, postsd_G1, n_G1,
prem_G2,presd_G2, postm_G2,postsd_G2, n_G2)
G


# Option 1 (could be SMCC as well I suppose)
G1 <- escalc(measure="SMCRH", m1i=postm_G1, m2i=prem_G1, sd1i=presd_G1,
ni=n_G1, sd2i = postsd_G1, ri=c(rep(0.7,50)), data=G)
G2 <- escalc(measure="SMCRH", m1i=postm_G2, m2i=prem_G2, sd1i=presd_G2,
ni=n_G2, sd2i = postsd_G2, ri=c(rep(0.7,50)), data=G)
dat <- data.frame(yi = G1$yi - G2$yi, vi = G1$vi + G2$vi)
dat
# Crude mean of Effect sizes
mean(dat$yi)

# Option 2
pldpre_sd = sqrt((presd_G1^2 + presd_G2^2) / 2)
ES = ((postm_G1 - prem_G1) - (postm_G2 - prem_G2)) / pldpre_sd
ES
# Crude mean of Effect sizes from this formula
mean(ES)


to 16. maalisk. 2023 klo 17.36 Viechtbauer, Wolfgang (NP) (
wolfgang.viechtbauer at maastrichtuniversity.nl) kirjoitti: