[R-meta] escalc error interpretation

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Aug 27 08:47:20 CEST 2021


Just to confirm, this is indeed the issue:

escalc(measure="PLO", xi=0, mi=0)

Error in escalc(measure = "PLO", xi = 0, mi = 0) :                                                                    
  One or more group sizes are < 1.

If there are 0 people for whom the event of interest did occur (xi) and 0 people for whom the event did not occur (mi), then the group size (xi+mi) must be 0.

Best,
Wolfgang

>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Michael Dewey
>Sent: Thursday, 26 August, 2021 19:09
>To: Philippe Tadger; r-sig-meta-analysis using r-project.org
>Subject: Re: [R-meta] escalc error interpretation
>
>Dear Philippe
>
>Looking at out1 and out2 there seems to be a pair which are both zero.
>Perhaps that is the issue.
>
>Michael
>
>On 26/08/2021 17:58, Philippe Tadger wrote:
>> Dear all,
>>
>> I have an error with the function escalc,
>>
>> Error in escalc(measure = "PLO", xi = out1, mi = out2, data = ddd, add =
>> 1/2, : One or more group sizes are < 1.
>>
>> that I don't know how to interpret what is wrong with my data. As follow
>> a reproducible example:
>>
>> library(metafor)
>> ddd<-data.frame(
>>     tn = c(5535L,
>>            5535L,1222L,1222L,
>>            1032L,1032L,1392L,
>>            1392L,990L,990L,
>>            182L,182L,1406L,
>>            1406L,21043L,21043L,
>>            100L,100L,9647L,
>>            9647L),
>>     tp = c(15L,15L,
>>            2L,2L,2L,2L,
>>            10L,10L,2L,2L,1L,
>>            1L,9L,9L,28L,28L,
>>            0L,0L,33L,33L),
>>     np = c(15L,15L,
>>            2L,2L,2L,2L,
>>            10L,10L,2L,2L,1L,
>>            1L,9L,9L,28L,28L,
>>            0L,0L,36L,36L),
>>     nn = c(5802L,
>>            5802L,1234L,1234L,
>>            1071L,1071L,1438L,
>>            1438L,1005L,1005L,
>>            194L,194L,1416L,
>>            1416L,21900L,
>>            21900L,105L,105L,
>>            10121L,10121L),
>>     MA_num = c(10L,10L,
>>                10L,10L,10L,10L,
>>                10L,10L,10L,10L,
>>                10L,10L,10L,10L,
>>                10L,10L,10L,10L,
>>                10L,10L),
>>     SUBMA_num = c(45L,45L,
>>                   45L,45L,45L,45L,
>>                   45L,45L,45L,45L,
>>                   45L,45L,45L,45L,
>>                   45L,45L,45L,45L,
>>                   45L,45L),
>>     study = c(735L,
>>               735L,738L,738L,739L,
>>               739L,740L,740L,
>>               744L,744L,745L,
>>               745L,747L,747L,750L,
>>               750L,753L,753L,
>>               755L,755L),
>>     out1 = c(15L,
>>              5535L,2L,1222L,2L,
>>              1032L,10L,1392L,2L,
>>              990L,1L,182L,9L,
>>              1406L,28L,21043L,
>>              0L,100L,33L,
>>              9647L),
>>     out2 = c(0L,267L,
>>              0L,12L,0L,39L,
>>              0L,46L,0L,15L,0L,
>>              12L,0L,10L,0L,
>>              857L,0L,5L,3L,
>>              474L),
>>     study = as.factor(c("1","1","2","2",
>>                         "3","3","4","4",
>>                         "5","5","6","6",
>>                         "7","7","8","8",
>>                         "9","9","10",
>>                         "10")),
>>     group = as.factor(c("1","2","1","2",
>>                         "1","2","1","2",
>>                         "1","2","1","2",
>>                         "1","2","1","2",
>>                         "1","2","1","2"))
>> )
>> levels(ddd$group) <- c("sensitivity", "specificity")
>> ddd <- escalc(measure="PLO", xi=out1, mi=out2, data=ddd, add=1/2, to="all",
>>                 include=group=="sensitivity")
>>
>> The error is triggered for the following conditional in the escalc function
>>
>> if (any <https://rdrr.io/r/base/any.html>(ni < 1, na.rm=TRUE
>> <https://rdrr.io/r/base/logical.html>)) stop
>> <https://rdrr.io/r/base/stop.html>(mstyle$stop
>> <https://rdrr.io/r/base/stop.html>("One or more group sizes are < 1."))
>>
>> Thanks in advance for your time


More information about the R-sig-meta-analysis mailing list