「診断精度の分析」 入門 東京医科歯科大学 救命救急センター 白石 淳
「診断精度の分析」 入門
東京医科歯科大学 救命救急センター
白石 淳
Goals
• 診断精度分析の基礎。 – 分割表に親しむ – 感度・特異度など指標の意味を理解する。
• 臨床と研究での応用。 – 臨床推論への応用。 – 診断精度の研究への応用。
登場する手法
• 2X2表の統計 – 【検査陽性 OR 陰性】 X 【疾患陽性 OR 陰性】
• 検査値が連続値の場合 – ROC解析
• 複数の検査で予測する場合 – 予測モデル
登場する手法
• 2X2表の統計 – 【検査陽性 OR 陰性】 X 【疾患陽性 OR 陰性】
• 検査値が連続値の場合 – ROC解析
• 複数の検査で予測する場合 – 予測モデル
医学生と医師を対象とした プレテスト
プレテスト成績(N=16)
研修医以下 ≥3年目 (N=11) (N=5) P
感度 0.73 0.60 1.000 特異度 0.64 0.60 1.000 陽性的中率 0.73 0.40 0.300 陰性的中率 0.64 0.40 0.596 陽性尤度比 0.00 0.00 1.000 陰性尤度比 0.00 0.00 1.000
ハチワンダイバー
22XX
22
44
ゼロヨンダイバー
疾患あり 疾患なし
検査陽性 a b
検査陰性 c d
2X2表の概念
疾患あり 疾患なし
検査陽性 a b
検査陰性 c d
Reference standard"評価者は決められない
Index test"評価者が決める
この甲斐性なしっ
!!!!!!!!
検査とアウトカム
晩ご飯は美味しかった
晩ご飯は不味かった
今朝、 妻と喧嘩した a b
今朝、 妻と喧嘩しな
かった c d
検査とアウトカム
晩ご飯は妻が作った
晩ご飯は店屋物だった
今朝、 妻と喧嘩した a b
今朝、 妻と喧嘩しな
かった c d
2X2表の概念
感度 = a/(a+c) 特異度 = d/(b+d) 陽性的中率 = a/(a+b) 陰性的中率 = d/(c+d) 陽性尤度比 = 感度/(1-特異度) = {a(b+d)}/{b(a+c)} 陰性尤度比 = (1-感度)/特異度 = {c(b+d)}/{d(a+c)} オッズ比 = 陽性尤度比/陰性尤度比 = ad/bc リスク比 = 陽性的中率/(1-陰性的中率) = {a(c+d)}/{c(a+b)}
疾患あり 疾患なし
検査陽性 a b
検査陰性 c d
その1 縦読みで感度特異度
疾患あり 疾患なし
検査陽性 8 4
検査陰性 2 6
感度 80%
特異度 60%
疾患あり 疾患なし 陽性 的中率 67% 検査陽性 8 4
検査陰性 2 6 陰性 的中率 75%
その2 横よみで陽性・陰性的中率
解析の方法(epiR package) > # Diagnostic Accuracy> #> # estimating sensitivity, specificity,> # positive predictive value and negative predictive value> # from 2X2 cross table> > table<-matrix(c(8,2,4,6),2,2)> library(epiR) 要求されたパッケージ survival をロード中です 要求されたパッケージ splines をロード中です Package epiR 0.9-45 is loadedType help(epi.about) for summary information
解析の方法(epiR package) > epi.tests(table) Disease + Disease - TotalTest + 8 4 12Test - 2 6 8Total 10 10 20
Point estimates and 95 % CIs:---------------------------------------------------------Apparent prevalence 0.6 (0.36, 0.81)True prevalence 0.5 (0.27, 0.73)Sensitivity 0.8 (0.44, 0.97)Specificity 0.6 (0.26, 0.88)Positive predictive value 0.67 (0.35, 0.9)Negative predictive value 0.75 (0.35, 0.97)---------------------------------------------------------
解析の方法(epiR package) > epi.tests(table,verbose=T)$aprev est lower upper1 0.6 0.3605426 0.8088099
$tprev est lower upper1 0.5 0.2719578 0.7280422
$se est lower upper1 0.8 0.4439045 0.9747893
$sp est lower upper1 0.6 0.2623781 0.8784477
……
有病率が違うと、
疾患あり 疾患なし
検査陽性 8 400
検査陰性 2 600
感度 80%
特異度 60%
有病率が違うと、
疾患あり 疾患なし 陽性 的中率 2% 検査陽性 8 400
検査陰性 2 600 陰性 的中率 100%
有病率が違うと、 > table<-matrix(c(8,2,400,600),2,2)> epi.tests(table) Disease + Disease - TotalTest + 8 400 408Test - 2 600 602Total 10 1000 1010
Point estimates and 95 % CIs:---------------------------------------------------------Apparent prevalence 0.4 (0.37, 0.43)True prevalence 0.01 (0, 0.02)Sensitivity 0.8 (0.44, 0.97)Specificity 0.6 (0.57, 0.63)Positive predictive value 0.02 (0.01, 0.04)Negative predictive value 1 (0.99, 1)---------------------------------------------------------
有病率が違うと、
有病率 %
感度 %
特異度 %
陽性的中率 %
陰性的中率 %
1
90 90
8 100
5 32 99
10 50 99
50 90 90
母集団は何か?
• The STARD Statement – ITEM 3 Describe the study populaSon: the inclusion and exclusion criteria, seWng and locaSons where data were collected.
– ITEM 4 Describe parScipant recruitment: was recruitment based on presenSng symptoms, results from previous tests, or the fact that the parScipants had received the index tests or the reference standard?
有病率を考慮した診断法 ベイズの定理 (検査陽性の時)
pretest odds = a+ cb+ d
posttest odds = ab=a+ cb+ d
×a(b+ d)b(a+ c)
= pretest odds× sensitivity1− specificity
= pretest odds× positive likelihood ratio(LR+)
有病率を考慮した診断法 ベイズの定理 (検査陰性の時)
pretest odds = a+ cb+ d
posttest odds = cd=a+ cb+ d
×c(b+ d)d(a+ c)
= pretest odds×1− sensitivityspecificity
= pretest odds×negative likelihood ratio(LR−)
演習1
• 実際にやってみましょう。 – ERを右下腹痛の症例が受診しました。この中で
虫垂炎の有病率は20%です。 – 白血球数が異常の時(LR+ = 4)と正常の時(LR-‐ = 0.2)でそれぞれ検査後確率を求めなさい。
• 検査前オッズ = 0.2/(1-‐0.2) = 0.25 • 白血球数が異常の時
– 検査後オッズ = 0.25 X 4 = 1 – 検査後確率 = 1/(1+1) = 0.5
• 白血球数が正常の時 – 検査後オッズ = 0.25 X 0.2 = 0.05 – 検査後確率 = 0.05/(1+0.05) = 0.05
登場する手法
• 2X2表の統計 – 【検査陽性 OR 陰性】 X 【疾患陽性 OR 陰性】
• 検査値が連続値の場合 – ROC解析
• 複数の検査で予測する場合 – 予測モデル
連続変数を使って、
RROOCC
解析を
やってみせ
るだと !!!!!!!!
検査値が連続変数の場合
疾患あり 疾患なし
検査値 ≥ 閾値
a b
検査値 < 閾値
c d
疾患あり 疾患なし
検査値
疾患
頻度
疾患あり 疾患なし
最適な閾値
検査値
疾患
頻度
疾患あり 疾患なし
感度重視
検査値
疾患
頻度
疾患あり 疾患なし
特異度重視
検査値
疾患
頻度
疾患あり 疾患なし
検査値
疾患
頻度
疾患あり 疾患なし 最適な閾値
感度重視
特異度重視
検査値
疾患
頻度
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
理想的な検査 AUC = 1.00
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
サイコロを振るのと同等 AUC =0.50
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
サイコロを振るのと同等 AUC =0.50
LR+ = 1LR- = 1
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
サイコロを振るのと同等 AUC =0.50
LR+ = 1LR- = 1
LR+ = +∞LR- = 0
1 - specificity
Sens
itivi
ty
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
Troponin I AUC = 0.75
FIGURE. Serum troponin I for detection of myocardial infarction
in subjects with chest pain within 3hours from onset
Net ReclassificaSon Improvement
• 2つの予測モデルを比較して、 NRI = 疾患陽性群でのΔ偽陰性率 + 疾患陰性群でのΔ偽陽性率
Cook, CirculaSon 2007 Pencina et al., StaSstMed 2008
Net ReclassificaSon Improvement
hdp://d.hatena.ne.jp/kaz_yos/20121205/1354681916
ROC解析の紹介(pROC package)
# 準備 ISwR (Introductory Statistics with R)というパッケージの# juulというデータを使います。月経開始の有無(menarche, 0/1)と# 年齢(age)が入っています# ageという連続変数を取る検査が、月経開始を予測できるかどうかを# roc解析を用いて解析してみます。> library(ISwR)
次のパッケージを付け加えます: '‘ISwR’' > data(juul)
# ROC解析に使うのはpROCというパッケージです。> library(pROC) 要求されたパッケージ plyr をロード中です 次のパッケージを付け加えます: '‘pROC’'
ROC解析の紹介(pROC package)
> roc.test<-roc(menarche~˜age,data=juul)> plot.roc(roc.test)
Call:roc.formula(formula = menarche ~˜ age, data = juul)
Data: age in 369 controls (menarche 1) < 335 cases (menarche 2).Area under the curve: 0.9852
Specificity
Sensitivity
0.0
0.2
0.4
0.6
0.8
1.0
1.0 0.8 0.6 0.4 0.2 0.0
登場する手法
• 2X2表の統計 – 【検査陽性 OR 陰性】 X 【疾患陽性 OR 陰性】
• 検査値が連続値の場合 – ROC解析
• 複数の検査で予測する場合 – 予測モデル
変数が複数の場合
予測モデルの概念
log p1− p
= B0+B1X1+B2X 2+
尤度比とオッズ比の考え方は、診断精度でもロジスティック回帰でもいっしょ。1因子で予測するか(分割表)、2因子以上で予測するかの差でしか無い。
良い予測モデルを作るためには
• よくある一般的な状況(外来とかERとか)。 • その場のできるだけ早期に知りうる情報のみ
からモデルができる。 • 「真のアウトカム」
モデル構築とモデル検証
• コホート研究やランダム化試験のデータ • ロジスティック回帰分析を用いて予測変数を
抽出し、モデルを作る。 • 「別のコホート」を用いて、モデルを検証する。
日本外傷データバンク
ü 参加172施設の外傷データベース ü AIS≥3
hdps://www.jtcr-‐jatec.org/traumabank/index.htm
N=70686
欠損値のある対象 N=17568
N=44149
構築コホート N=22075
検証コホート N=22074
CRASH-2
ü 重大な出血リスクを伴う外傷患者にトラネキサム酸の効果を検討した大規模多施設ランダム化試験
hdp://crash2.ishtm.ac.uk
N=20207
欠損値のある対象 N=2713
外部検証コホート N=17494
The new score variables associated with in-hospital death
Variables Estimate Standard Error P
Variables Estimate Standard
Error P
Injury type Respiratory rate, /min Blunt 0.53 0.14 <.001 0 - 5 1.67 0.20 <.001
Penetrating 0.00 Reference 6 - 29 0.00 Reference 30 - 39 0.32 0.07 <.001
Age, years old 40 - 0.85 0.13 <.001
0 - 54 0.00 Referenc
e 55 - 79 0.62 0.06 <.001 Systolic blood pressure, mmHg
80 - 1.16 0.08 <.001 0 - 49 2.38 0.15 <.001 50 - 69 1.36 0.14 <.001
Glasgow coma scale, 3-15 70 - 89 0.86 0.10 <.001 3 - 4 3.62 0.08 <.001 90 - 109 0.43 0.08 <.001
5 3.22 0.18 <.001 90 - 179 0.00 Reference 6 2.44 0.12 <.001 180 - 0.26 0.09 <.01
7 - 8 2.04 0.10 <.001 9 - 11 1.54 0.10 <.001 Goodness of fitting
12 - 13 1.13 0.09 <.001 Hosmer-Lemeshow test 14 0.55 0.09 <.001 χ2 0.078
15 0.00 Reference P 1.000
Trauma Rating with Injury type, Age,
Glasgow coma scale, rEspiratory rate and
Systolic blood pressure.
TRIAGES score
Feel free to contact Atsushi Shiraishi, MD ([email protected]) for more information.
TRIAGES score (0-18 pts) Trauma Rating with Injury type, Age, Glasgow coma scale, rEspiratory rate and Systolic blood pressure in the primary survey.
Blunt (1) Penetrating (0)
0 - 54 (0) 55 - 79 (1) 80 - (2)
15 (0) 14 (1) 12 - 13 (2) 9 - 11 (3) 7 - 8 (4) 6 (5) 5 (6) 3 - 4 (7)
40 - (2) 30 - 39 (1) 6 - 29 (0) 0 - 5 (3)
180 - (1) 110 - 179 (0) 90 - 109 (1) 70 - 89 (2) 50 - 69 (3) 0 - 49 (5)
I( ) + A( ) + G( ) + E( ) + S( ) = TRIAGES score ( ) TRIAGES score of 0-3, 4-8, 9-15 and 16-18 predicts mortality of <5% (mean of 4%), 5-49% (mean of 15%), 50-95% (mean of 64%), and >95% (mean of 99%), respectively.
Age (A)
Type of Injury (I)
Glasgow Coma Scale (G)
Systolic Blood Pressure (S)
Respiratory Rate (E)
Specificity
Sensitivity
0.0
0.2
0.4
0.6
0.8
1.0
1.0 0.8 0.6 0.4 0.2 0.0Specificity
Sensitivity
0.0
0.2
0.4
0.6
0.8
1.0
1.0 0.8 0.6 0.4 0.2 0.0
ROC解析
Area Under Curve TRIAGES: 0.886 RTS: 0.874 P<.001 (bootstrap)
Area Under Curve TRIAGES: 0.812 RTS: 0.802 P<.001 (bootstrap)
RTS RTS TRIAGES TRIAGES
JTDB CRASH-2
まとめ
• 2X2表という、初歩的な(しかし正確に理解されていない)統計手法のまとめから、ROC解析まで。
• 臨床医はベイズの定理を臨床推論に応用しましょう。