forestplot.jpg
R實戰 | 森林圖繪制
回答一下R繪圖實戰|GSEA富集分析圖 - 知乎 (zhihu.com)里會員的問題。簡單的森林繪制。
Multivariate logistic regression determined independent candidate diagnostic biomarkers.
Ref:He S, Deng Z, Li Z, et al. Signatures of 4 autophagy-related genes as diagnostic markers of MDD and their correlation with immune infiltration. J Affect Disord. 2021;295:11-20. doi:10.1016/j.jad.2021.08.005
22
森林圖
森林圖是一種簡單直觀地展示單一研究和匯總研究的圖形,廣泛應用于薈萃分析、觀察研究和臨床試驗中。
Odds ratio(OR)
在病例對照研究(case-control study)中,分析暴露風險因素與疾病(或者用藥)的關聯程度;主要是反映暴露與疾病之間關聯強度的指標,OR常適用于病例對照研究,也可以運用于前瞻性的研究(當觀察時間相等時)
OR值的統計學意義:
- OR>1,暴露與疾病的危險度增加,兩者呈正相關
- OR<1,暴露與疾病的危險度減少,兩者呈負相關
- OR=1,暴露與疾病的危險度無關,兩者呈不相關
繪制
library(survival)
library(survminer)
library(eoffice) #導出ppt用
# 構建模型
# 以colon數據為示例數據
# 時間變量是time,結局變量是status,自變量選擇 sex,rx和 adhere
model <- coxph( Surv(time, status) ~ sex + rx + adhere,
data = colon )
# 森林圖
ggforest(model, #coxph得到的Cox回歸結果
data = colon, #數據集
main = 'Hazard ratio of colon', #標題
cpositions = c(0.05, 0.15, 0.35), #前三列距離
fontsize = 1, #字體大小
refLabel = 'reference', #相對變量的數值標簽,也可改為1
noDigits = 3 #保留HR值以及95%CI的小數位數
)
Snipaste_2022-03-04_22-16-36
參考
GitHub - cardiomoon/autoReg: R package autoReg
木舟筆記2022年度VIP企劃
關于木舟筆記2022年度VIP會員企劃
https://mp.weixin.qq.com/s/cTf38LqiV07ILX3PeVEQFA
往期內容
- 跟著Nature學作圖 | 配對啞鈴圖+分組擬合曲線+分類變量熱圖
- (免費教程+代碼領取)|跟著Cell學作圖系列合集
- 跟著Nat Commun學作圖 | 1.批量箱線圖+散點+差異分析
- 跟著Nat Commun學作圖 | 2.時間線圖
- 跟著Nat Commun學作圖 | 3.物種豐度堆積柱狀圖
- 跟著Nat Commun學作圖 | 4.配對箱線圖+差異分析
- 跟著 Nat Med. 學作圖 | GSVA+limma差異通路分析+發散條形圖