1
我想在我的森林圖中區分統計顯着性(OR = 1.0)和臨牀顯着性(OR = 1.5)。我使用forestplot包創建了此圖,示例代碼如下。是否可以添加垂直線(同時保持線沒有差異)?如何在R包森林圖中添加第二條垂直線
library(forestplot)
test_data <- structure(list(
mean = c(NA, NA, 1, 0.5, 2),
lower = c(NA, NA, .5, .25, 1.5),
upper = c(NA, NA, 1.5, .75, 2.5)),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -5L),
class = "data.frame")
tabletext <- cbind(
c("", "Outcome", "Outcome 1", "Outcome 2", "Outcome 3"),
c("", "OR", "1 (0.5 - 1.5)", "0.5 (0.25 - 0.75)", "2.0 (1.5 - 2.5)"))
forestplot(tabletext,
test_data,
new_page = TRUE,
xlog = TRUE,
boxsize = .25
)
感謝您的建議。它似乎繪製了一條垂直線,但在森林地塊的右側,而不是森林地塊本身? – JediMike