简体   繁体   English

如何在不丢失 plot 汇总信息的情况下编辑 meta::forest plot 的列? 我正在关注 R bookdown 中的 Harrer 元分析

[英]How do I edit the columns of a meta::forest plot without losing plot summary information? I'm following Harrer meta-analysis in R bookdown

First-time user, fairly new to R, sorry if this question is not brilliantly asked...第一次使用,对 R 相当陌生,抱歉,如果这个问题没有被很好地提出......

Problem:问题:

My forest plot in R using meta went well until it comes to editing using the parameters described here https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/generating-a-forest-plot.html My forest plot in R using meta went well until it comes to editing using the parameters described here https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/generating-a-forest-plot.html

Question:问题:

Can anyone detect why, when I use the meta parameter leftcols to change the columns to "Study, Cohort and Size" (from Study, TE and seTE), it labels the left columns as hoped for, BUT gets rid of “Random effect model total, Prediction interval and heterogeneity” text from the bottom left of the plot?任何人都可以检测到为什么,当我使用参数leftcols将列更改为“Study、Cohort and Size”(来自 Study、TE 和 setTE)时,它会将左列标记为所希望的,但摆脱了“随机效应 model总,预测区间和异质性”plot 左下角的文本? It also centres the text in the left columns but I would ideally like it to remain left-aligned.它还将左列中的文本居中,但理想情况下我希望它保持左对齐。 Better even than just detecting why, can anyone suggest a work-around?甚至比仅仅检测原因更好,任何人都可以提出解决方法吗?

What I've tried:我试过的:

I've tried using other parameters of meta::forest() to add back in info such as pooled.totals , print.I2, text.predict etc but once leftcols parameter is used it seems to override them.我尝试使用 meta::forest() 的其他参数添加回信息,例如pooled.totalsprint.I2 、 text.predict等,但是一旦使用leftcols参数,它似乎会覆盖它们。 I can use leftlabs instead of leftcols to rename the columns but that leaves the values of these columns as before (Study, TE and seTE).我可以使用leftlabs而不是 leftcols 来重命名列,但这些列的值与以前一样(Study、TE 和 setTE)。

Code:代码:

library(meta)
m.random.REML <- metagen(logTE,
                         logSE,
                         data=madata,
                         studlab=paste(Author),
                         comb.fixed = FALSE,
                         comb.random = TRUE,
                         method.tau= "REML",
                         hakn = FALSE,
                         prediction=TRUE, 
                         sm = "RR")

meta::forest(m.random.REML,
             sortvar = seTE, 
             comb.random = TRUE,
             rightlabs = c("RR", "95% CI", "Weight"),
        ######This next line is what causes the problem 
             leftcols = c("Study", "Cohort", "Size"),  
             
)

Spent ages stuck on this myself but this is what I got:我自己花了很长时间在这上面,但这就是我得到的:

You need to specify "studlab" as that is what essentially prints the summary and using leftcols overwrites this.您需要指定"studlab" ,因为这实际上是打印摘要并使用 leftcols 覆盖它。 You have already put the information into "studlab" when you created the meta.创建元数据时,您已经将信息放入"studlab" You then need to call it in the plot and relabel it as you wish:然后您需要在 plot 中调用它并根据需要重新标记它:

library(meta)
m.random.REML <- metagen(logTE,
                     logSE,
                     data=madata,
                     studlab=paste(Author),
                     comb.fixed = FALSE,
                     comb.random = TRUE,
                     method.tau= "REML",
                     hakn = FALSE,
                     prediction=TRUE, 
                     sm = "RR")

meta::forest(m.random.REML,
         sortvar = seTE, 
         comb.random = TRUE,
         rightlabs = c("RR", "95% CI", "Weight"),
    ######This next line is what causes the problem 
         leftcols = c("studlab", "Cohort", "Size"),  
         leftlabs = c("Study", "Cohort", "Size"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM