[R-meta] Ratio of Means
Also, I cannot reproduce this problem. library(metafor) arm.df <- read.table(header=TRUE, text = " id study group mean sd n 1 Arici 2009 Exp 35.73 5.24 27 2 Arici 2009 Ctl 62.93 8.67 27 3 Arslan 2011 Exp 4.25 2.03 20") escalc(measure='MNLN', mi=mean, sdi=sd, ni=n) ### this obviously fails since the variables cannot be found escalc(measure='MNLN', mi=mean, sdi=sd, ni=n, data=arm.df) ### works attach(arm.df) escalc(measure='MNLN', mi=mean, sdi=sd, ni=n) ### also works, but don't use attach (shudder) detach(arm.df) Best, Wolfgang -----Original Message----- From: Michael Dewey [mailto:lists at dewey.myzen.co.uk] Sent: Friday, July 21, 2017 13:01 To: Nathan Pace; Viechtbauer Wolfgang (SP); r-sig-meta-analysis at r-project.org Subject: Re: [R-meta] Ratio of Means Dear Nathan Try using the data parameter rather than attaching arm.df. Alternatively call the standard deviation something other than sd.
On 20/07/2017 22:17, Nathan Pace wrote:
Hi, Thanks for the pointers and links. Next problem is using the measure = ?MNLN? in escalc. I created the 2k data frame.
arm.df
study group mean sd n 1 Arici 2009 Exp 35.73 5.24 27 2 Arici 2009 Ctl 62.93 8.67 27 3 Arslan 2011 Exp 4.25 2.03 20 4 Arslan 2011 Ctl 11.25 5.03 20 5 Arslan 2013 Exp 5.15 4.29 100 6 Arslan 2013 Ctl 9.1 4.68 100 7 Aydogan 2008 Exp 0.27 0.08 40 8 Aydogan 2008 Ctl 0.35 0.09 40 9 Cakan 2008 Exp 11 2 20 10 Cakan 2008 Ctl 12 2 20 11 Cobby 1999 Exp 35 20.4 24 12 Cobby 1999 Ctl 54.9 28.3 21 13 Dahl 1997 Exp 21.2 7.88 22 14 Dahl 1997 Ctl 18.7 5.9 21 15 Dilmen 2010 Exp 18.1 13.93 20 16 Dilmen 2010 Ctl 30 11.32 19 17 Durmus 2007 Exp 30.5 11.55 25 18 Durmus 2007 Ctl 42.74 12.33 25 19 Emir 2010 Exp 7.65 0.78 30 20 Emir 2010 Ctl 13.8 2.26 30 21 Fayaz 2004 Exp 12 6 17 22 Fayaz 2004 Ctl 22 13 17 23 Jokela 2010 Exp 38.85 16.8 40 24 Jokela 2010 Ctl 45.15 18.9 40 25 Khalili 2013 Exp 3 2.28 25 26 Khalili 2013 Ctl 4.2 1.57 25 27 Kilieaslan 2010 Exp 20.56 0.4 25 28 Kilieaslan 2010 Ctl 28.6 0.35 25 29 Koppert 2006 Exp 17 22 25 30 Koppert 2006 Ctl 38 22 25 31 Kvalsvik 2003 Exp 16 5 30 32 Kvalsvik 2003 Ctl 20 6 30 33 Montgomery 1996 Exp 27.1 27 19 34 Montgomery 1996 Ctl 34.5 15.1 20 35 Moon 2011 Exp 8.7 5.4 36 36 Moon 2011 Ctl 12.6 6.9 35 37 Munishankar 2008 Exp 33.8 23.8 25 38 Munishankar 2008 Ctl 44.1 24.4 25 39 Sinatra 2005 Exp 38.3 35.1 49 40 Sinatra 2005 Ctl 57.4 52.3 52 41 Syal 2010 Exp 9.53 1.88 30 42 Syal 2010 Ctl 10.19 2.08 30 43 Toygar 2008 Exp 16.5 11.1 30 44 Toygar 2008 Ctl 34.3 11.8 30 45 Yalcin 2012 Exp 48.53 12.4 26 46 Yalcin 2012 Ctl 73.03 22.41 27 The call to escalc returned an error:
arm.df <- escalc(measure = 'MNLN', mi = mean, sdi = sd, ni = n)
Error in sdi < 0 : comparison (3) is possible only for atomic and list types ????? Nathan