I'm trying to do a meta-analysis from a number of Odds ratios and their confidence intervals. The source articles do not report standard errors.
In order to use rma.uni()
from the metafor
package, I need to supply variances (through vi=" "
) or standard errors (throuh sei = " "
). So I calculated the standard errors in the following way (logor = log(odds ratio), UL= CI upper limit, LL = CI lower limit)
:
se1<-(log(UL)-logor)/1.96
se2<-(log(OR)-log(LL))/1.96
My problem is, the standard errors derived in this way differ a little bit, although they should be the same. I think this is due to the fact that the CI's were rounded by the authors. My solution was to take the average of these as the standard errors in the model.
However when I fit the model and plot the forest plot, the resulting confidence intervals differ quite a bit from the ones I started with..
dmres<-rma.uni(yi=logor, sei=se, data=dm2)
forest(dmres, atransf=exp, slab=paste(dm2$author))
Is there a better way to do this? Maybe a function that I can put confidence intervals in directly?
Thanks a lot for your comments.
Update
Example data and code:
dm<-structure(list(or = c(1.6, 4.4, 1.14, 1.3, 4.5), cill = c(1.2,
2.9, 0.45, 0.6, 3.2), ciul = c(2, 6.9, 2.86, 2.7, 6.1)), .Names = c("or",
"cill", "ciul"), class = "data.frame", row.names = c(NA, -5L))
dm$logor<-log(dm$or)
dm$se1<-(log(dm$ciul)-dm$logor)/1.96
dm$se2<-(dm$logor-log(dm$cill))/1.96
dm$se<-(dm$se1+dm$se2)/2
library(metafor)
dmres<-rma.uni(yi=logor, sei=se, data=dm)
forest(dmres, atransf=exp)