[R-meta] Calculating pooled effect size
Dr. Gerta Rücker
gert@@ruecker @end|ng |rom un|k||n|k-|re|burg@de
Sat Aug 12 13:18:19 CEST 2023
Dear Adelina,
It seems that you ignored that the pooling goes on the log scale. The correct calculation is therefore (using the notation from your R code):
> exp(sum(my_metagen$TE * weights_random)/sum(weights_random))
[1] 10.5499
where my_metagen$TE are the log-transformed rates and exp() backtransforms the average on the log scale back to the original scale.
Best,
Gerta
UNIVERSITÄTSKLINIKUM FREIBURG
Institute for Medical Biometry and Statistics
Dr. Gerta Rücker
Guest Scientist
Stefan-Meier-Straße 26 · 79104 Freiburg
gerta.ruecker using uniklinik-freiburg.de
https://www.uniklinik-freiburg.de/imbi-en/employees.html?imbiuser=ruecker
-----Ursprüngliche Nachricht-----
Von: R-sig-meta-analysis <r-sig-meta-analysis-bounces using r-project.org> Im Auftrag von Adelina Artenie via R-sig-meta-analysis
Gesendet: Samstag, 12. August 2023 12:28
An: r-sig-meta-analysis using r-project.org
Cc: Adelina Artenie <adelina.artenie using bristol.ac.uk>
Betreff: [R-meta] Calculating pooled effect size
Hi,
This is probably a silly question but can�t see where my error is, so it would be great to have your thoughts. I am doing a RE meta-analysis of rates and the pooled rate that I am getting does not equal the value I get from summing the individual effects multiplied by their prob. weights. I am ignoring the SE for this exercise, just looking at the pooled effect.
In this example, the pooled effect produced by R is 10.5499. If I do sum(individual rates * w.random) /sum(w.random), I get 12.45 (768.85 / 61.75). The pooled overall effect in R is consistently smaller relative to what I get when I calculate this by hand.
Thank you in advance.
Adelina
***
library(meta)
library(metafor)
my_dat <- data.frame(
ID = 1:19,
Rate = c(14.1, 19.4, 19.0, 12.5, 5.8, 7.2, 14.0, 11.6, 22.5, 11.1, 9.5, 1.1, 9.8, 7.9, 11.2, 28.7, 7.1, 15.5, 11.2),
LB = c(9.6, 14.8, 11.6, 9.7, 4.3, 4.2, 6.0, 5.6, 11.6, 8.2, 8.0, 0.8, 7.9, 7.1, 8.9, 20.6, 4.3, 13.1, 9.0),
UB = c(20.7, 25.5, 31.1, 16.1, 7.7, 12.1, 32.5, 24.4, 43.8, 14.9, 11.3, 1.6, 12.2, 8.7, 14.2, 40.2, 11.7, 18.3, 13.9)
)
ln_rate <- log(my_dat$Rate)
ln_LB <-log(my_dat$LB)
ln_UB <-log(my_dat$UB)
my_metagen <- metagen(TE = ln_rate,
lower = ln_LB,
upper = ln_UB,
studlab = ID,
data = my_dat,
sm = "IRLN",
method.tau = "DL",
comb.fixed = FALSE,
comb.random = TRUE, backtransf = TRUE,
title = "title",
text.random = "Overall")
summary(my_metagen)
weights(my_metagen)
study_ids <- my_metagen$studlab
weights_random <- my_metagen$w.random
weight_table <- data.frame(Temporary_ID = study_ids, w.random = weights_random)
print(weight_table)
[[alternative HTML version deleted]]
More information about the R-sig-meta-analysis
mailing list