R语言绘制森林图:
首先,加载R包,即library(forestplot)
text <- structure(list(
mean <- c(NA, 1.0115, 0.9175, 0.9814, 0.9700, 1.1298, 1.0018, 0.9845, 0.9664, 0.7375, 1.0597, 1.3398, 4.0502),
lower <- c(NA, 1.0029, 0.6511, 0.9679, 0.9614, 1.0692, 1.0004, 0.9761, 0.7081, 0.5222, 0.7401, 0.8483, 2.5625),
upper <- c(NA, 1.0201, 1.2929, 0.9951, 0.9787, 1.1939, 1.0033, 0.9930, 1.3189, 1.0417, 1.5174, 2.1159, 6.4017)),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -13L),
class = "data.frame")
table <- cbind(
c("Covariates", "PM2.5(1y_before)", "Gender", "Age", "Baseline_eGFR", "24h_upro", "UA", "Hb", "M1", "E1", "S1", "T1", "T2"),
c("HR", "1.012", "0.918", "0.981", "0.970", "1.129", "1.002", "0.985", "0.966", "0.738", "1.059", "1.339", "4.050"),
c("P-value", "0.008", "0.623", "0.008", "<0.001", "<0.001", "0.010", "<0.001", "0.829", "0.084", "0.751", "0.209", "<0.001"),
c("", "**", "", "**", "****", "***", "*", "***", "", ".", "", "", "***"))
forestplot(table,
text,new_page = TRUE,
is.summary=c(TRUE,rep(FALSE,12)),
clip=c(0.1, 6.5),
xlog=TRUE,
col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))