Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgroup plot with metaprop "Error in x$labels[[i]] : subscript out of bounds" #48

Closed
fohofmann opened this issue Nov 29, 2022 · 1 comment

Comments

@fohofmann
Copy link

Hi everyone.

I am trying to calculate proportional meta.analysis with clusters and subgroups. The meta-analysis works fine and as expected, however, forest() seems - at least for me - broken:

forest(res, subgroup=T)
Error in x$labels[[i]] : subscript out of bounds

A reproducible example:

# libraries
library(meta)
library(data.table)

# data
dt = data.table(
 ID = rep(1:5, each=3),
 AE = rep(c("minor","major","deadly"),5),
 ni = rep(c(25,19,101,32,50), each=3),
 xi = c(2,3,3,4,1,0,29,13,4,7,4,1,7,2,1) )

# meta-analysis & forest plot
res = metaprop(xi, ni, cluster=ID, subgroup=AE, data=dt, tau.common=T)
forest(res)

A similar issue was described earlier for metamean() ( #41 ), but was solved meanwhile.

Any help would be highly appreciated.
Best, Felix

@guido-s
Copy link
Owner

guido-s commented Nov 29, 2022

Thank you for pointing out this bug (not directly related to issue #41). Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants