Skip to content

[R-meta] escalc() function and weights

3 messages · Prof. Mario Petretta, Wolfgang Viechtbauer

#
Dear All,

in a previous post (see below) it was pointed out by Wolfgang Viechtbauer
that the use of weight in the escalc () function is deprecated.

Please, it is possible to clarify:

1) Why is the use of weight in the escalc () function is now deprecated?

2) What is the correct code to use for the example of the tutorial on the
"Metafor" package and the "escalc" function using the "long" bcg data
obtained with the reshape2 function, as shown in the previous post ?

Thank you for your time

Mario Petretta

 

 

Mario Petretta

Professor of Internal Medicine

Department of Translational Medical Science

University of Naples Federico II

Naples - Italy

 

 
<https://www.mail-archive.com/search?l=r-help at r-project.org&q=subject:%22Re%
5C%3A+%5C%5BR%5C%5D+Error+message+in+meta%5C-analysis+package+Metafor%5C-wei
ghts+%3D%5C%22%5C%22%22&o=newest> Re: [R] Error message in meta-analysis
package Metafor-weights =""

 
<https://www.mail-archive.com/search?l=r-help at r-project.org&q=from:%22Viecht
bauer%2C+Wolfgang+%5C%28SP%5C%29%22> Viechtbauer, Wolfgang (SP)
<https://www.mail-archive.com/search?l=r-help at r-project.org&q=date:20200616>
Tue, 16 Jun 2020 09:51:21 -0700

Dear Amoatwi,

 

This way of using the escalc() function has been deprecated. It might be
added 

back once there is actually any benefit from having this functionality, but
for 

years it just meant that I had to maintain two different ways of doing the 

exact same thing without any additional benefits.

 

Best,

Wolfgang
#
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
#
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