[英]Improve Forest plot for subgroup analysis (not for meta-analysis)?
Currently my forest plots for subgroup analysis (not for meta-analysis) in R are like the following...目前我在 R 中用于子组分析(不用于荟萃分析)的森林图如下...
library("dplyr")
library(ggplot2)
library(survminer)
library(survival)
library(forestmodel)
pretty_lung <- lung %>%
transmute(time,
status,
Age = age,
Sex = factor(sex, labels = c("Male", "Female")),
ECOG = factor(lung$ph.ecog),
`Meal Cal` = meal.cal)
print(forest_model(coxph(Surv(time, status) ~ ., pretty_lung)))
However, the sizes/heights of the squares are not proportional to the subgroup sample size.但是,正方形的大小/高度与子组样本大小不成比例。 In other words, I would expect that the smaller the confidence interval, the larger the boxes/squares would be.
换句话说,我希望置信区间越小,盒子/正方形就越大。 Is there a way to fix that (as in this example: https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(05)61026-4/fulltext )?
有没有办法解决这个问题(如本例中: https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(05)61026-4/fulltext )?
So, after some time I've found a decent solution (using another package):所以,一段时间后,我找到了一个不错的解决方案(使用另一个包):
devtools::install_github("ewenharrison/finalfit")
library(finalfit)
library(dplyr)
library(ggplot2)
library(survminer)
library(survival)
pretty_lung <- lung %>%
transmute(time,
status,
Age = age,
Sex = factor(sex, labels = c("Male", "Female")),
ECOG = factor(lung$ph.ecog),
`Meal Cal` = meal.cal)
explanatory = c("Age", "Sex", "ECOG", "`Meal Cal`")
dependent = "Surv(time, status)"
pretty_lung %>%
hr_plot(dependent, explanatory, dependent_label = "Survival")
The output: output:
It may not be perfect, but it is another option and this package does the job with the sizes/heights of the squares它可能并不完美,但它是另一种选择,这款 package 可以使用正方形的大小/高度来完成这项工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.