Skip to content
Prev 2364 / 5636 Next

[R-meta] Calculating effect size for subsets of data

Dear Tarun,

If I understand you correctly, then there should be 16 different combinations of A, B, C, and D but one of them (A=B=C=D=0) cannot occur, so essentially there are 15 combinations that were observed. As a result, you should have gotten a warning when fitting the model that a redundant predictor was dropped from the model. Let's consider a simpler case with just A and B:

set.seed(1234)
k <- 900
A <- c(rep(0,k/3), rep(1,k/3), rep(1,k/3))
B <- c(rep(1,k/3), rep(0,k/3), rep(1,k/3))
vi <- rep(.01, k)
yi <- rnorm(k, 0.5 * A + 0.1 * B + 0.3*A*B, sqrt(vi))

A <- factor(A)
B <- factor(B)

res <- rma(yi, vi, mods = ~ A*B)
res

These are the model results:

         estimate      se      zval    pval    ci.lb    ci.ub 
intrcpt   -0.3019  0.0100  -30.1904  <.0001  -0.3215  -0.2823  *** 
A1         0.7963  0.0082   97.5319  <.0001   0.7803   0.8123  *** 
B1         0.4032  0.0082   49.3825  <.0001   0.3872   0.4192  ***

The results are a bit tricky to interpret, so I would suggest a different parameterization:

res <- rma(yi, vi, mods = ~ A:B + 0)
res

       estimate      se      zval    pval   ci.lb   ci.ub 
A1:B0    0.4944  0.0058   85.6397  <.0001  0.4831  0.5058  *** 
A0:B1    0.1013  0.0058   17.5462  <.0001  0.0900  0.1126  *** 
A1:B1    0.8976  0.0058  155.4771  <.0001  0.8863  0.9090  ***

Now we can clearly see that A1:B0 is the estimated effect when A is given alone, A0:B1 is the estimated effect when B is given alone, and A1:B1 is the estimated effect when A and B are given together.

Best,
Wolfgang