Skip to content

[R-meta] Error Stopped because k = 0 after sub setting​.

8 messages · Klaow sota, Michael Dewey, Gerta Ruecker

#
I have some problems with analysis in subgroup
It showed this message:
 > # fit random-effects model in the three subgroups
Error: Stopped because k = 0 after sub setting?.

How should I fix it?
Is it caused from vi, yi?

Best regards,
Klaow
#
Dear Klaow

Without your data it is hard to be sure. I assume you have checked that 
the variable interven does indeed contain some values "PZQ"?

Michael
On 17/09/2022 11:44, Klaow sota wrote:

  
    
  
#
Dear Michael,

Thank you so much for your suggestions.
I attached the data(details of my analysis) below.
yi and vi needed to run for rma. However, I got that error message as I mentioned in the previous email.

# fit random-effects model in the three subgroups
res.s <- rma(yi, vi, subset=(interven=="PZQ"),data=dat)-->Got error
->Error: Stopped because k = 0 after subsetting.
res.r <- rma(yi, vi, subset=(interven=="Integrated"),data=dat)-->Got error
res.a <- rma(yi, vi, subset=(interven=="Health Ed"),data=dat)-->Got error

# add summary polygons for the three subgroups

addpoly(res.s, row=18.5, cex=0.90, atransf=exp, mlab=mlabfun("RE Model for Subgroup", res.s))
addpoly(res.r, row= 7.5, cex=0.90, atransf=exp, mlab=mlabfun("RE Model for Subgroup", res.r))
addpoly(res.a, row= 1.5, cex=0.90, atransf=exp, mlab=mlabfun("RE Model for Subgroup", res.a))

Is it error source of yi or vi? How should I solve this problem? Should I cut some data?

Best,
P SOTA


Order
author
year
tpos
tneg
cpos
cneg
period
lengint
lati
interven
yi
vi
12
Wisetsang
2017
0
50
3
47
2
4.00
15
health
-1.94591015
2.246498599
4
Tangsawad
2022
0
137
0
92
3
3.50
16
health
-0.39465419
3.982000935
13
Srivicha
2017
0
42
0
42
2
1.50
16
integrated
0.00000000
3.953488372
10
Songserm(2)
2021
1
46
0
47
3
3.00
15
integrated
1.09861229
2.625000000
9
Songserm(1)
2021
0
26
7
22
3
12.00
15
integrated
-2.60268969
2.062962963
7
Sommani(2)
1984
363
579
242
200
1
12.00
16
integrated
-0.35123028
0.003563038
6
Sommani(1)
1984
94
137
61
65
1
12.00
16
integrated
-0.17371489
0.014766228
1
Sommani
1987
97
903
140
260
1
36.00
16
integrated
-1.28322218
0.013952135
3
Sayasone
2017
3
42
29
12
2
1.00
18
pzq
-2.36177396
0.321203626
5
Saowakontha
1993
11
179
173
180
1
36.00
16
integrated
-2.13595234
0.088593419
15
Pimchan
2021
1
28
0
30
3
1.75
16
integrated
1.13140211
2.601075269
2
Panithanang
2018
1
32
0
33
2
3.00
14
integrated
1.09861229
2.607843137
16
Ketrun
2021
12
112
39
99
3
6.00
16
integrated
-1.07168288
0.093663466
8
Jong
1985
1
18
0
10
1
1.00
18
pzq
0.50077529
2.525757576
11
Cheepcharoenrat
2020
18
77
16
71
2
12.00
15
health
0.02981426
0.096034987
14
Chayngam
2020
1
37
3
35
2
6.00
17
health
-1.09861229
1.280701754
#
I apologize for the messy data from the previous email.
The screenshot photo might be better, I attached.
I curious that yi/vi probably get problem and made the error happened.

Best,
Klaow
#
Dear Klaow,


You now that R is case-sensitive? That is, see the following:


# Set

interven <- "pzq"

# Then

interven=="pzq" # provides
[1] TRUE

# However,

interven=="PZQ" # provides
[1] FALSE


That is, you have to spell the values in the code exactly as spelled in 
the data set.


Best,

Gerta



Am 17.09.2022 um 17:06 schrieb Klaow sota:

  
    
#
Dear Klaow

There is no "PZQ" in that file as far as I can see. There is a "pzq" though.

Michael
On 17/09/2022 16:06, Klaow sota wrote:

  
    
  
#
Thank you very much. Finally, I got it.

Best,
Klaow

Get Outlook for iOS<https://aka.ms/o0ukef>
#
Thank you so much for all supporting.

Best,
Klaow

Get Outlook for iOS<https://aka.ms/o0ukef>