guido-s / meta

Official Git repository of R package meta
http://cran.r-project.org/web/packages/meta/index.html
GNU General Public License v2.0
81 stars 31 forks source link

Suggestion for Improvement: Allow Subsetting with RoB Figure in Forest Plot #61

Closed nelsoncarvasjr closed 1 month ago

nelsoncarvasjr commented 2 months ago

Hello professor Guido,

I hope this message finds you well. My name is Nelson, and I am using the meta package implemented in R for some analyses. First of all, I would like to express my gratitude for the excellent work in developing this package.

Recently, I encountered an issue when trying to perform a sensitivity analysis using the argument subset= while including the Risk of Bias (RoB) figure. My view is that it would be very helpful if we could apply the subset directly in the forest plot when using the RoB figure. This would greatly facilitate the hypothesis testing process, eliminating the need to export the data to Excel and then reimport it.

I believe this functionality could add significant value to the package and simplify the work for many users. Thank you in advance for your attention, and I am available to provide more details or assist in any way necessary for the implementation of this improvement.

Best regards,

Nelson

An example:

n.e <- c(34,  32,  43, 222)
m.e <- c(32.23, 27.50, 36.30, 36.63)
sd.e <- c(3.06, 3.27, 7.40, 8.06)

n.c <- c(30, 30, 43, 73)
m.c <- c(34.26, 33.00, 38.10, 41.60)
sd.c <- c(3.96, 3.48, 8.30, 8.40)

d1 <- c(“Low", "Some concerns”, “Low", "Low" )
d2 <- c(“Low", "Some concerns”, “Low", "Low" ) 
d3 <- c(“Low", "Some concerns”, “Low", "Low" ) 
d4 <- c(“Low", "Some concerns”, “Low", "Low" ) 
d5 <- c(“Low", "Some concerns”, “Low", "Low" ) 
d6 <- c(“Low", "Some concerns”, “Low", "Low" ) 

ma <- metacont(n.e, m.e, sd.e,
               n.c, m.c, sd.c,
               common = F)

ma_rob <- rob(d1, d2, d3, d4, d5, d6,
                data = ma,
                categories = c("Low", "Some concerns", "High"),
                col = c("green", "yellow", "red"),
                symbols = c("+", "!", "-"),
                domains = c("Bias arising from the randomization process",
                            "Bias due to deviations from intended interventions",
                            "Bias due to missing outcome data",
                            "Bias in measurement of the outcome",
                            "Bias in selection of the reported result",
                            "Overall bias"))

forest(ma_rob)

# Subset

ma <- metacont(n.e, m.e, sd.e,
               n.c, m.c, sd.c,
               common = F,
               subset = -2)

ma_rob <- rob(d1, d2, d3, d4, d5, d6,
                data = ma,
                categories = c("Low", "Some concerns", "High"),
                col = c("green", "yellow", "red"),
                symbols = c("+", "!", "-"),
                domains = c("Bias arising from the randomization process",
                            "Bias due to deviations from intended interventions",
                            "Bias due to missing outcome data",
                            "Bias in measurement of the outcome",
                            "Bias in selection of the reported result",
                            "Overall bias"))

forest(ma_rob)

For bug reports, please mention your

guido-s commented 1 month ago

Dear Nelson,

Instead of subsetting in forest.meta() it is possible to subset using update.meta(). Accordingly, the command forest(update(ma_rob, subset = -2)) should work.

Best, Guido

nelsoncarvasjr commented 1 month ago

Thank you professor.

Em ter., 30 de jul. de 2024 às 06:06, Guido Schwarzer < @.***> escreveu:

Dear Nelson,

Instead of subsetting in forest.meta() it is possible to subset using update.meta(). Accordingly, the command forest(update(ma_rob, subset = -2)) should work.

Best, Guido

— Reply to this email directly, view it on GitHub https://github.com/guido-s/meta/issues/61#issuecomment-2257854245, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWY4GK73IWHMYPGFC3XYBA3ZO5JS5AVCNFSM6AAAAABKPVV2ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXHA2TIMRUGU . You are receiving this because you authored the thread.Message ID: @.***>