Skip to content
Prev 2229 / 5636 Next

[R-meta] R: escalc() function and weights

Dear Wolfgang,

Thanks again for your time !

Mario 

-----Messaggio originale-----
Da: Viechtbauer, Wolfgang (SP)
[mailto:wolfgang.viechtbauer at maastrichtuniversity.nl] 
Inviato: venerd? 26 giugno 2020 17:33
A: Prof. Mario Petretta <petretta at unina.it>;
r-sig-meta-analysis at r-project.org
Oggetto: RE: [R-meta] escalc() function and weights

Dear Mario,

I removed the 'formula interface' to escalc() because it did not add
anything beyond what you can do with the escalc() function without that way
of specifying the data. Keeping it in the package meant that I had to
maintain two different but equivalent ways of specifying the data for
escalc() and hence extra work for me.

So, the example where the data are specified in the 'long' format from the
JSS package won't work anymore. However, one can easily restructure such a
long format dataset back to a wide one with the reshape() function. So,
given the dataset as shown on page 11 in the article, one could do:

dat.fm$cell <- 1:4
dat.wide <- reshape(dat.fm, direction="wide", idvar="study",
timevar="cell")[c(1,4,7,10,13)]

and then use escalc():

escalc(measure="RR", ai=freq.1, bi=freq.2, ci=freq.3, di=freq.4,
data=dat.wide)

Best,
Wolfgang