Sei sulla pagina 1di 93

TEST DIAGNOSTICI

(test dicotomici)

Generalità

I Test, in generale, sono procedure ben definite, oggettive, e possibilmente standardizzate, utili per
ottenere una ben precisa informazione.

In ambito medico tale informazione sarà, in genere, la probabilità di malattia.

Si definisce Test Diagnostico un test che viene applicato ad una popolazione che mostra sintomi clinici che,
in qualche misura, fanno sospettare la presenza di malattia oggetto di studio.

Si definisce Test di screening un test che viene applicato alla popolazione generale indipendentemente dal
suo stato di salute attuale.a

Il risultato positivo di un test si indicherà con T+, quello negativo con T-


M indicherà i malati e M indicherà i sani.

Capacità discriminante di un Test

Il risultato dell’applicazione di un Test su una popolazione, si potrà sempre sintetizzare in una tabella 2x2,
con l’esito del test sulle righe/colonne e la condizione malato o sano sulle colonne/righe (confusion matrix).
La tabella sotto riportata mostra i risultati di un test diagnostico sottoposto ad un campione di 200 soggetti

Tab.1a Tab.1b
M M M M
T+ 52 11 63 T+ a b (a+b)
T- 37 100 137 T- c d (c+d)
89 111 200 (a+c) (b+d) N

a → TP soggetti malati e positivi al test


b → FP soggetti sani e positivi al test
c → FN soggetti malati e negativi al test
d → TN soggetti sani e negativi al test

Un test con elevate prestazioni dovrà massimizzare TP e TN e minimizzare FP e FN.


La capacità di un test diagnostico di individuare i soggetti provvisti di un certo carattere (in generale
malato/sano) si valuta tramite due misure: Sensibilità (SENS)b e Specificità (SPEC) che sono di seguito
definite (1.1).

SENS = P (T + | M ) SPEC = P (T − | M ) (1.1)


TP TN
SENS = SPEC =
TP + FN TN + FP

Sensibilità: è la probabilità che un soggetto malato risulti positivo al test


Specificità: è la probabilità che un soggetto non malato risulti negativo al test

a
Nel seguito, quando parleremo di Test Diagnostici ci riferiremo sia ai test di screening, sia ai test diagnostici
propriamente detti.
b
Qualche volta indicata con il termine recall.
1
Una sensibilità elevata è importante quando l'obiettivo è quello di non farsi sfuggire i casi di malattia, come
nel caso di malattie gravi rapidamente evolutive, in cui un intervento tempestivo può essere cruciale.
Se un test molto sensibile risulta negativo, si può ragionevolmente ritenere che la malattia non esista e che
non occorra, generalmente, procedere con ulteriori esami.

Una specificità elevata è importante quando è necessario essere sicuri della diagnosi fatta, come nel caso di
una diagnosi che indichi un intervento di chirurgia demolitiva.
Se un test molto specifico risulta positivo, si può ragionevolmente ritenere che la malattia sia presente e
che si possa generalmente procedere con i trattamenti previsti.

In generale, test molto sensibili sono poco specifici (possono più facilmente produrre falsi positivi).
Viceversa, test molto specifici sono in generale poco sensibili (possono più facilmente produrre falsi
negativi).

E’ importante sottolineare che sensibilità e specificità sono caratteristiche intrinseche di un test e non
dipendono, in particolare, dalla prevalenza di malattia.

Sensibilità e specificità sono delle proporzioni e i loro intervalli di confidenza si calcolano con i consueti
metodi utilizzati per la determinazione degli intervalli di confidenza delle proporzioni: con
l’approssimazione della binomiale alla normale, con il metodo cosiddetto esatto, con il metodo di Wilson
etc.1

Esempio 1
Con riferimento ai dati di Tab.1a, determinare la Sensibilità del test e il relativo intervallo di confidenza
al 95%.

a 52
SENS ≡ P (T + | M ) = = = 0.584
a + c 89

• Intervallo con Metodo Esatto

n = numero di prove r = numero di successi pˆ = r / n

Fdf 1, df 2,α / 2 


STATA
→ invFtail ( df1, df2, α /2 )

r +1 52 + 1 53
UL = = = = 0.68786
r + 1 + ( n − r ) / F2r + 2,2n − 2r ,α /2 52 + 1( 89 − 52 ) / F106,74,α /2 53 + 37 / 1.5384
r 52 52
LL = = = = 0.4749
r + ( n − r + 1) ⋅ F2r + 2,2n − 2r ,α / 2 52 + ( 89 − 52 + 1) ⋅ F76,104,α / 2 52 + 38 ⋅ 1.513

. cii 89 52
-- Binomial Exact --
Variable | Obs Mean Std. Err. [95% Conf. Interval]
-------------+---------------------------------------------------------------
| 89 .5842697 .0522417 .4749132 .6878559

2
• Intervallo secondo Wald

CI95% = pˆ ± z0.025 ⋅ pˆ (1 − pˆ ) / n = SENS ± z0.025 ⋅ SENS (1 − SENS ) / n = {0.4819;0.6867} (1.2)

. cii 89 52,wald

-- Binomial Wald ---


Variable | Obs Mean Std. Err. [95% Conf. Interval]
-------------+---------------------------------------------------------------
| 89 .5842697 .0522417 .4818778 .6866616

• Intervallo secondo Wilson2

r + zα2 / 2 / 2 zα / 2 n  zα2 / 2 
CI95% = ±  p
ˆ (1 − p
ˆ ) +  = {0.4805;0.6811} (1.3)
n + zα2 / 2 n + zα2 / 2  4n 

. cii 89 52,wilson

------ Wilson ------


Variable | Obs Mean Std. Err. [95% Conf. Interval]
-------------+---------------------------------------------------------------
| 89 .5842697 .0522417 .480471 .6810947

3
• Intervallo secondo Wald

CI95% = pˆ ± z0.025 ⋅ pˆ (1 − pˆ ) / n = SENS ± z0.025 ⋅ SENS (1 − SENS ) / n = {0.4819;0.6867} (1.2)

. cii 89 52,wald

-- Binomial Wald ---


Variable | Obs Mean Std. Err. [95% Conf. Interval]
-------------+---------------------------------------------------------------
| 89 .5842697 .0522417 .4818778 .6866616

• Intervallo secondo Wilson2

r + zα2 / 2 / 2 zα / 2 n  zα2 / 2 
CI95% = ±  p
ˆ (1 − p
ˆ ) +  = {0.4805;0.6811} (1.3)
n + zα2 / 2 n + zα2 / 2  4n 

. cii 89 52,wilson

------ Wilson ------


Variable | Obs Mean Std. Err. [95% Conf. Interval]
-------------+---------------------------------------------------------------
| 89 .5842697 .0522417 .480471 .6810947

3
Fig. 1a PPV al variare della prevalenza e di SENS con SPEC=0.92

Fig. 1b NPV al variare della prevalenza e di SENS con SPEC=0.92

5
Fig. 1c PPV al variare della prevalenza e di SPEC con SENS=0.92

Fig. 1d NPV al variare della prevalenza e di SPEC con SENS=0.92

6
Esempio 2
La tabella sotto riportata mostra la relazione tra il risultato di un test (liver scan) e la corretta diagnosi
basata o sull’esame autoptico, o sulla biopsia oppure sull’ispezione chirurgica.

Tab.2 Relation between results of liver scan and correct


diagnosis3
Pathology
Liver Scan Abnormal Normal Total
Abnormal 231 32 263
Normal 27 54 81
Total 258 86
Drum DE,Christacapoulos JS. Hepatic Scintigraphy in clinical
decision making. J Nucl Med 1972;13:908-15

Determinare SENS, SPEC, PPV e NPV del test.

SENS ≡ P (T +|M ) = 231 / 258 SPEC ≡ P (T −|M ) = 54 / 86


PPV ≡ P ( M |T + ) = 231 / 263 NPV ≡ P ( M |T − ) = 54 / 81

Confidence Intervals (95%)


Exact Wald Wilson
SENS 0.895 0.851; 0.930 0.858; 0.933 0.852; 0.927
SPEC 0.628 0.517; 0.730 0.526; 0.730 0.522; 0.722
PPV 0.878 0.833; 0.9156 0.839; 0.918 0.833; 0.912
NPV 0.667 0.553; 0.768 0.564; 0.769 0.558; 0.760

Altri indici di interesse

Percentuali di veri positivi TP, di falsi positivi FP, di veri negativi TN e di falsi negativi FN.

P (TP ) = P (T + ∩ M ) = P ( M ) ⋅ P (T +|M ) = P ( M ) ⋅ SENS (1.8)


P ( FP ) = P (T + ∩ M ) = (1 − P ( M ) ) ⋅ P (T +|M ) = (1 − P ( M ) ) ⋅ (1 − SPEC ) (1.9)
P ( TN ) = P (T − ∩M ) = (1 − P ( M ) ) ⋅ P (T − | M ) = (1 − P ( M ) ) ⋅ SPEC (1.10)
P ( FN ) = P (T − ∩M ) = P ( M ) ⋅ P (T − | M ) = P ( M ) ⋅ (1 − SENS ) (1.11)

7
Indici globali di accuratezza diagnostica

Quando si confrontano più test diagnostici sarebbe utile disporre di un indice globale in grado di riassumere
la loro performance. Sono stati proposti vari indici che, tutti, soffrono di una medesima limitazione: pesano
nello stesso modo le misclassificazioni. Mentre, dal punto di vista clinico, a secondo dei casi, si cercherà di
favorire la minimizzazione dei falsi positivi o i falsi negativi. Quindi, un criterio generale per valutare la
performance di più test diagnostici non esiste, ma si dovrà, di volta in volta, operare delle scelte in base al
contesto clinico soppesando, in termini globali, i costi delle misclassificazioni e benefici delle corrette
classificazioni.

• Efficienza diagnostica
Viene definita come il rapporto tra il numero test corretti (TP + TN) e il numero totale di test effettuati.

TP + TN
Efficiency ≡
TP + TN + FP + FN

• Youden’s Index

La performance del test tra i malati può essere misurata dalla frazione dei correttamente classificati, tra i
malati, diminuita della frazione dei soggetti misclassificati sempre tra i malati.

Tab.3
M M
T+ a b (a+b)
T- c d (c+d)
(a+c) (b+d) N
a −c
Perf (M ) =
a+c
Si noti che se a = c , ossia se i correttamente classificati tra i malati sono pari ai misclassificati tra i malati,
la capacità discriminatoria del test, tra i malati, è nulla e coerentemente: Perf (M ) = 0
D’altra parte se tra i malati non ci fossero misclassificazioni ( c = 0 ) la capacità discriminatoria, tra i
malati sarebbe perfetta e, coerentemente: Perf (M ) = 1

In modo del tutto analogo la performance del test tra i non malati (controlli) può essere valutata dal
seguente rapporto:
d −b
Perf (M ) =
b+d

Assumendo che i falsi positivi siano indesiderabili quanto i falsi negativi, l’indice globale (sui malati e sui
controlli) potrebbe calcolarsi come la media dei due indici precedenti e calcolati separatamente nei due
gruppi (malati/controlli). Tale indice globale prende appunto il nome di Youden’s index.4

1a −c d −b 1 a d c d 
J=  + =  + − − 
2a +c b+d  2a +c b+d a +c b+d 
(1.12)
1 a d (a + c ) − a (b + d ) − d  a d 1
=  + − − = + − 2 = SENS + SPEC − 1
2a +c b+d a+c b+d  a+c b+d 2
ad − bc
J= (1.13)
( a + b )( c + d )

8
Fig. 1c PPV al variare della prevalenza e di SPEC con SENS=0.92

Fig. 1d NPV al variare della prevalenza e di SPEC con SENS=0.92

6
J = SENS + SPEC − 1 = 0.895 + 0.628 − 1 = 0.523

Intervallo di fiducia secondo Wald (1.14)

ac bd 231 ⋅ 27 32 ⋅ 54
seJ = + = + = 0.055497
(a + c ) (b + d ) ( 231 + 27 ) ( 32 + 54)
3 3 3 2

( Jl , Ju ) = 0.523 ± 1.96 ⋅ 0.055497 = {0.414; 0.632}

Intervallo di fiducia secondo Wilson (1.15)

A = 1.96 ⋅ 0.00049 + 0.002331 B = 1.96 ⋅ 0.00026 + 0.002901

( Jl , Ju ) = {0.419; 0.633}

Di seguito i risultati ottenuti, in STATA, con il personal ado file diagtesti

. diatesti 54 32 \ 27 231

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 54 32 | 86
2 | 27 231 | 258
-----------+----------------------+----------
Total | 81 263 | 344
Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson
----------------------------------------------------------------------
SENS 0.895 0.858 0.933 0.851 0.930 0.852 0.927
SPEC 0.628 0.526 0.730 0.517 0.730 0.522 0.723
PPV 0.878 0.839 0.918 0.833 0.915 0.833 0.912
NPV 0.667 0.564 0.769 0.553 0.768 0.559 0.760
LR+ 2.406 1.823 3.176
LR- 0.167 0.113 0.247
----------------------------------------------------------------------

Youden index = 0.523 95%CI ( 0.414- 0.632) Normal Approximation


95%CI ( 0.419- 0.633) Wilson's Approximation

Esempio 4

I dati in seguito riportati si riferiscono ai risultati di due test diagnostici (una versione classica, test A, e
una modificata, test B) applicati, su popolazioni diverse (indipendenti), allo scopo di diagnosticare la
presenza di malattia.
Si chiede di:
• Valutare SENS, SPEC e J index dei due test con relativi intervalli di confidenza secondo Wilson
• Valutare se SENS, SPEC e J index siano statisticamente differenti nei due test
• Calcolare, gli intervalli di confidenze delle differenze di SENS, SPEC e J index (Wald Method) nei
due test
Tab.3
TEST A TEST B
T+ T- Total T+ T- Total
M 95 6 101 M 40 11 51
NM 75 33 108 NM 7 23 30

10
Calcolo di SENS, SPEC, J index e corrispondenti intervalli di confidenza nei due test

NB: i due campioni sottoposti al test sono INDIPENDENTI

Per gli intervalli di confidenza di SENS e SPEC possiamo usare la (1.3) o la (1.16) mentre per gli intervalli di
confidenza dello Youden index useremo la (1.15)

p0 + t / 2 p0 q0 t + t 2 / 4 zα2 / 2
pL,U = ± t= (1.16)
1+ t 1+ t n

SENSA = P (T +|M ) = 95 / 101 = 0.940

95 + 1.962 / 2 1.96 101  1.962 


CI95% ( SENSA ) = ±  0 .94 (1 − 0 .94 ) +  = {0.876; 0.972}
101 + 1.962 101 + 1.962  4 ⋅ 101 

SPECA = P (T −|M ) = 33 / 108 = 0.306

33 + 1.962 / 2 1.96 101  1.962 


CI95% ( SPECA ) = ±  0 .306 (1 − 0 .306 ) +  = {0.227; 0.398}
108 + 1.962 108 + 1.962  4 ⋅ 108 

J A = SENSA + SPECA − 1 = 0.941 + 0.306 = 0.246

( Jl , Ju ) = ( J − A, J + B ) = {0.134; 0.331}

con

l1 (1 − l1 ) u2 (1 − u2 ) u1 (1 − u1 ) l2 (1 − l2 )
A = zα / 2 + B = zα / 2 +
M M M M

0.876 (1 − 0.876 ) 0.398 (1 − 0.398) 0.972 (1 − 0.972 ) 0.227 (1 − 0.227 )


A = 1.96 + =0.112 B = 1.96 + = 0.085
101 108 101 108

TEST A TEST B
Value CI95% (Wilson) Value (Wilson)
SENS 0.941 0.876 - 0.972 0.784 0.654 - 0.875
SPEC 0.306 0.227 - 0.398 0.767 0.591 - 0.882
J 0.246 0.134 - 0.331 0.551 0.377 - 0.749

11
Di seguito i risultati completi ottenuti, in STATA, con il personal ado file diatesti
. diatesti 33 75 \ 6 95

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 33 75 | 108
2 | 6 95 | 101
-----------+----------------------+----------
Total | 39 170 | 209

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.941 0.894 0.987 0.875 0.978 0.876 0.972
SPEC 0.306 0.219 0.392 0.221 0.402 0.227 0.398
PPV 0.559 0.484 0.633 0.481 0.635 0.484 0.631
NPV 0.846 0.733 0.959 0.695 0.941 0.703 0.928
LR+ 1.354 1.184 1.549
LR- 0.194 0.085 0.444
----------------------------------------------------------------------

Youden index = 0.246 95%CI ( 0.148- 0.345) Normal Approximation


95%CI ( 0.134- 0.331) Wilson's Approximation

. diatesti 23 7 \ 11 40

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 23 7 | 30
2 | 11 40 | 51
-----------+----------------------+----------
Total | 34 47 | 81

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.784 0.671 0.897 0.647 0.887 0.654 0.875
SPEC 0.767 0.615 0.918 0.577 0.901 0.591 0.882
PPV 0.851 0.749 0.953 0.717 0.938 0.723 0.926
NPV 0.676 0.519 0.834 0.495 0.826 0.508 0.809
LR+ 3.361 1.730 6.532
LR- 0.281 0.161 0.492
----------------------------------------------------------------------

Youden index = 0.551 95%CI ( 0.362- 0.740) Normal Approximation


95%CI ( 0.377- 0.749) Wilson's Approximation

. diatesti 56 82 \ 17 135

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 56 82 | 138
2 | 17 135 | 152
-----------+----------------------+----------
Total | 73 217 | 290

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.888 0.838 0.938 0.827 0.933 0.828 0.929
SPEC 0.406 0.324 0.488 0.323 0.493 0.327 0.489
PPV 0.622 0.558 0.687 0.554 0.687 0.556 0.684
NPV 0.767 0.670 0.864 0.654 0.858 0.658 0.849
LR+ 1.495 1.288 1.735
LR- 0.276 0.169 0.451
----------------------------------------------------------------------

Youden index = 0.294 95%CI ( 0.198- 0.390) Normal Approximation


95%CI ( 0.191- 0.382) Wilson's Approximation

12
Valutazione differenze tra SENS, SPEC e J index nei due test

Le differenze statisticamente significative tra due generiche proporzioni p̂1 e p̂2 possono essere valutate
con degli z-testa in cui a denominatore inseriremo lo stimatore dell’errore standard delle differenze (sotto
ipotesi nulla).

pˆ1 − pˆ 2 x1 + x2
z= pˆ i = xi / ni pˆ = (1.17)
1 1  n1 + n2
pˆ (1 − pˆ ) ⋅  + 
 n1 n2 

Applicando la (1.17) a SENS, SPEC e J index avremo:

Sensibilità

SENSA − SENSB 0.941 − 0.784


z= = = 2.887 → P = 0.0039
 1 1   1 1 
SENS ⋅ (1 − SENS)  +  0.624 (1 − 0.624 ) ⋅  + 
 nMA nMB   101 51 

Le differenze tra le sensibilità sono statisticamente significative P =0.0039 < 0.05

Ovviamente allo stesso risultato si può giungere analizzando, con il test del χ12 , la tabella sotto riportata
ottenuta riassumendo i risultai dei test sui Malati.

Sensibilità
TEST A TEST B
T+ 95 40
T- 6 11
M M

. tabi 95 40\ 6 11,chi2 exact

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 95 40 | 135
2 | 6 11 | 17
-----------+----------------------+----------
Total | 101 51 | 152

Pearson chi2(1) = 8.3322 Pr = 0.004


Fisher's exact = 0.006
1-sided Fisher's exact = 0.005

a
Il test proposto dalla (1.17) ha una validità asintotica, se n1 e n2 sono sufficientemente grandi, la statistica z ha
una distribuzione normale con media nulla e varianza unitaria. Un criterio conservativo comunemente utilizzato
consiste nell’applicare il test proposto dalla (1.17) solo quando ciascuna della quantità n1 pˆ , n1 (1 − pˆ ) ,
n2 pˆ e n2 (1 − pˆ ) sia maggiore o uguale a 5. (cfr Pagano M. Gauvreau K. Biostatistica. IDELSEN-GNOCCHI). Se
queste condizioni non sono rispettate si può usare il Fisher’s Exact Test che, non basandosi sull’approssimazione
della binomiale con la normale, non ha validità solo asintotica.
13
Specificità

SPECA − SPECB 0.306 − 0.767


z= = = 4.55 → P < 0.0001
 1 1   1 1 
SPEC ⋅ (1 − SPEC )  +  0.406 (1 − 0.406 ) ⋅  + 
 nMA nMB   108 30 

Le differenze tra le specificità sono statisticamente significative P < 0.0001 < 0.05

Ovviamente allo stesso risultato si può giungere analizzando, con il test del χ12 , la tabella sotto riportata
ottenuta riassumendo i risultai dei test sui Non Malati.

Specificità
TEST A TEST B
T+ 75 11
T- 33 23
M M
. tabi 75 7\33 23,chi2 exact

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 75 7 | 82
2 | 33 23 | 56
-----------+----------------------+----------
Total | 108 30 | 138

Pearson chi2(1) = 20.7030 Pr = 0.000


Fisher's exact = 0.000
1-sided Fisher's exact = 0.000

J index

Prima soluzione.

Si utilizza la statistica z definita dalla (1.18) in cui al denominatore si pone lo standard error della
differenza dei due Youden index. Sotto H0 i due indici sono uguali, e l’indice comune può essere ottenuto
in due modi:

1. tramite le sensibilità e specificità comuni ossia le sensibilità e specificità pesate rispettivamente


per il numero di malati e non malati.
2. tramite la matrice globale dello studio

J A − JB
tn = (1.18)
se∆J

Tab.4
TEST Pooled
T+ T-
M 135 17
NM 82 56

135 SENSA ⋅ nMA + SENSB ⋅ nMB


SENS = = 0.888 SENS = = 0.888
135 + 17 nMA + nMB

14
56 SPECA ⋅ nMA + SPECB ⋅ nMB
SPEC = = 0.406 SPEC = = 0.406
82 + 56 nMA + nMB

J = SENS + SPEC − 1 = 0.294

Oppure, con riferimento alla Tab.4, dalla (1.13) si ha:

135 ⋅ 56 − 17 ⋅ 82
J= = 0.294
(135 + 7 )(82 + 56 )
Tenuto presente che:

SENS (1 − SENS ) SPEC (1 − SPEC )


esJ2 = +
nM nM

L’errore standard, sotto H0 , della differenza tra i due indici vale:

 SENS (1 − SENS ) SPEC (1 − SPEC )   SENS (1 − SENS ) SPEC (1 − SPEC ) 


es∆J =  + + +  = 0.115
 nMA nMA   nMB nMB 

E riprendendo la (1.18)

J A − JB 0.246 − 0.551
tn = = = 2.65 → P = 0.009
se∆J 0.115

Seconda Soluzione4

Si fa uso sempre della (1.18), ma l’errore standard della differenza NON viene calcolato sotto H0

J A − JB
tn =
se∆J

 SENSA (1 − SENSA ) SPECA (1 − SPECA )   SENSB (1 − SENSB ) SPECB (1 − SPECB ) 


es∆J =  + + + 
 nMA nMA   nMB nMB 

es∆J = 0.109

J A − JB 0.246 − 0.551
tn = = = 2.80 → P = 0.006
se∆J 0.109

Calcolo degli intervalli di confidenza delle differenze di SENS, SPEC e J index (Wald Method) nei due
test.

SENSA (1 − SENSA ) SENSB (1 − SENSB )


CI95% ( SENSA − SENS B ) = ( SENSA − SENS B ) ± 1.96 +
nMA nMB

CI95% ( SENSA − SENS B ) = {0.0583; 0.254}

SPECA (1 − SPECA ) SPECB (1 − SPECB )


CI95% ( SENSA − SPEC B ) = ( SPECA − SPEC B ) ± 1.96 +
nMA nMB

15
CI95% ( SENSA − SPEC B ) = {−0.636; − 0.2866}

CI95% ( J A − J B ) = ( J A − J B ) ± 1.96 ( esJA ) + ( esJB )


2 2
= −0.30483 ± 1.96 0.0501792 + 0.0963322

CI95% ( J A − J B ) = {−0.51772; − 0.09194}

16
Rapporti di verosimiglianza LR+ ed LR – e Odds Ratio.

P (T + | M ) SENS
LR + ≡ = (1.19)
P (T + | M ) 1 − SPEC
P (T − | M ) 1 − SENS
LR − ≡ = (1.20)
P (T − | M ) SPEC

Un test che abbia LR = 1 non è discriminante; un test invece è tanto migliore quanto LR si discosta da 1,
per valori molto maggiori di 1 per LR+ e per valori molto vicini allo 0 per LR –.

odds ratio OR.


P (T + | M ) P (T + | M ) SENS ⋅ SPEC LR +
OR ≡ = = (1.21)
1 − P (T + | M ) 1 − P (T + | M ) (1 − SENS ) ⋅ (1 − SPEC ) LR −
Un test che abbia OR = 1 non è discriminante; un test invece è tanto migliore quanto OR si discosta da 1.

I rapporti di verosimiglianza sono particolarmente utili per calcolare l’odds della malattia a posteriori
conoscendone l’odds a priori (cioè quello pre-test). Infatti:

P (M |T + ) P (M | T + ) P (M ) P (T + | M ) P (M ) SENS P (M )
= = ⋅ = ⋅ = ⋅ LR + cioè
1 − P (M |T + ) P (M | T + ) 1 − P (M ) P (T + | M ) 1 − P (M ) 1 − SPEC 1 − P (M )
odds a posteriori (con test positivo) = odds a priori ⋅ LR+

P (M |T −) P (M | T −) P (M ) P (T − | M ) P (M ) 1 − SENS P (M )
= = ⋅ = ⋅ = ⋅ LR − cioè
1 − P (M |T −) P (M | T −) 1 − P (M ) P (T − | M ) 1 − P (M ) SPEC 1 − P (M )
odds a posteriori (con test negativo) = odds a priori ⋅ LR–

Entrambi gli odds possono essere espressi in funzione dei numeri di test positivi e negativi nei gruppi
rispettivamente di malati e sani.

P (M ) SENS T+ | M
odds a posteriori ( con test positivo ) = odds a priori ⋅ LR + = = (1.22)
1 − P ( M ) (1 − SPEC ) T + | M

P ( M ) 1 − SENS T − | M
odds a posteriori ( con test negativo ) = odds a priori ⋅ LR – = = (1.23)
1 − P ( M ) SPEC T− | M

L’odds a posteriori con test positivo/negativo è pari al rapporto tra il numero di test positivi/negativi nei
malati e nei non malati.

Dalla conoscenza dell’odds a posteriori si risale alla conoscenza della probabilità della malattia, dato un
certo risultato del test. Si ha infatti:
odds a posteriori con T +
probabilità di malattia dato che il test sia positivo = P (M | T + ) =
1 + odds a posteriori con T +
odds a posteriori con T −
probabilità di malattia dato che il test sia negativo = P (M | T −) =
1 + odds a posteriori con T −
E’ anche possibile determinare la probabilità post-test per via grafica, utilizzando il nomogramma (Fig.3)
di seguito rappresentato6.

17
Fig.3

Individuata sull’asse di sinistra la probabilità di


malattia pre-test, si traccia la retta passante per il
valore del rapporto di verosimiglianza; sulla
intersezione della retta con l’asse di destra si legge la
corrispondente probabilità di malattia post-test.
Ad esempio, se LR+ = 5 e se la probabilità pre-test
è del 2%, la probabilità post-test risulta circa del
10%.
Se invece LR– = 0.1 e se la probabilità pre-test è del
2%, la probabilità post-test risulta circa dello 0.2%.
I due rapporti di verosimiglianza, LR+ ed LR–, sono
i parametri più efficaci per descrivere il
comportamento di un test, cioè la sua capacità di
discriminare sani e malati:
• l’LR+ permette una rapida valutazione della
probabilità a posteriori di malattia conseguente
ad un risultato positivo del test
• l’LR– permette una rapida valutazione della
probabilità a posteriori di malattia conseguente
ad un risultato negativo del test
In altri termini, l’LR+ contiene sinteticamente
l’informazione sull’impatto diagnostico di un test
positivo, impatto tanto più rilevante quanto più
LR+ risulta maggiore di 1. Per contro l’LR–
contiene sinteticamente l’informazione sull’impatto
diagnostico di un test negativo, impatto tanto più
rilevante, nel senso di escludere la presenza di
malattia, quanto più LR– risulta vicino a 0.
A titolo orientativo possiamo identificare delle fasce
di diverso impatto diagnostico:

LR+ LR- Impatto Diagnostico


1–2 0.5 – 1 molto scarso
2–5 0.2 – 0.5 scarso
5 – 10 0.1 – 0.2 rilevante
> 10 < 0.1 molto rilevante

18
Su un piano ROC, dove sulle ascisse si pone (1-SPEC) e sulle ordinate la SENS, è facile individuare un
punto A, le cui coordinate permettono di risalire alla SENS e alla SPEC del test stesso, nonché i rapporti
di verosimiglianza LR+ e LR–.7
Si consideri ad esempio un test A di SENS = 0.7 e SPEC = 0.6. Sul piano ROC sarà rappresentato con un
punto A di coordinate (0.7; 0.4). Dalla (1.19) è facile riconoscere che il luogo dei punti LR+ = 0.7/0.4 è
una retta che passa per A avente un coefficiente angolare m = tan α = SENS / (1 − SPEC ) .a
Dalla (1.20) per contro è facile riconoscere che il luogo dei punti con LR– = 03/0.6 è una retta che passa
per il punto A e avente un coefficiente angolare m = tan β = (1 − SENS) / SPEC .b

Fig.4 Rappresentazione sul piano ROC di un test con SENS = 0.7 e SPEC = 0.6

Fig. 5 Rappresentazione sul piano ROC di DUE test:


Test A (SENS = 0.7, SPEC = 0.6) ; Test B (SENS = 0.8, SPEC = 0.75)

a Tale retta passa anche per il punto (0; 0)


b Tale retta passa anche per il punto (1,1)
19
Esempio 5

Un soggetto ha a priori una probabilità di malattia pari al 60% e risulta positivo ad un test diagnostico di
SENS = 0.94 e di SPEC = 0.92. Determinare la probabilità a posteriori di malattia.

P( M ) 0.6
odds a priori = = = 1.5
1 − ( P ( M )) 0.4
SENS 0.94
LR+ = = = 11.75
1 − SPEC 0.08

odds a posteriori = 1.5 ⋅11.75 = 17.625

odds 17.625
P(M | T +) = = ≅ 0.946
1 + odds 18.625

Esempio 6

Mostriamo la valutazione di una procedura diagnostica8


I soggetti esaminati sono 1000. Valutiamo il grado di affidabilità dell’esame fisico condotto allo scopo di
identificare la presenza di una frattura, che sarà confermata o meno da esame radiologico. L’esame
radiologico è da ritenersi il gold standard ovvero il test di riferimento. I risultati sono mostrati in Tab.6.

Tab. 6
risultati radiologici
esame fisico Positivi (frattura) Negativi (no frattura) Totali
Positivo (frattura) 190 80 270
Negativo (no frattura) 10 720 730
Totali 200 800 1000

P (TP) 190 P (TN) 720


SENS = = = 0.95 SPEC = = = 0.90
P (M ) 200 P (M ) 800

190 720
PPV = P (M | T + ) = ≅ 0.70 NPV = P (M | T −) = ≅ 0.99
270 730

SENS 1 − SENS
LR + = = 9.5 LR − = ≅ 0.06
1 − SPEC SPEC

190 10
OR = = 171
80 720

20
Esempio 7

Mostriamo la valutazione di un test diagnostico9


I soggetti esaminati sono 445, tutti sospetti di trombosi venosa profonda e classificati in base ad un pre-
test clinico in soggetti a basso, medio, alto rischio trombotico. I soggetti sono stati sottoposti al test del D-
Dimero per valutare se la negatività del test combinata con un basso sospetto clinico è in grado di escludere
il manifestarsi di un episodio trombotico. Il periodo di follow-up, allo scopo di accertare eventuali
insorgenze di trombosi venosa profonda, ha avuto una durata di tre mesi.

Tab.7
Soggetti a basso rischio Soggetti a medio rischio
D-Dimero test Malati Non Malati Totali D-Dimero test Malati Non Malati Totali
T- 1 176 177 T- 7 113 120
T+ 4 25 29 T+ 17 51 68
Totali 5 201 206 Totali 24 164 188

Soggetti ad alto rischio Totali


D-Dimero test Malati Non Malati Totali D-Dimero test Malati Non Malati Totali
T- 2 8 10 T- 10 297 307
T+ 33 8 41 T+ 54 84 138
Totali 35 16 51 Totali 64 381 445

Osservando le tabelle è facile rilevare che SENS ed SPEC variano in funzione del rischio a priori di
malattia. Tratteremo questo problema nel successivo paragrafo. Per ora ci limitiamo a calcolare nei
quattro casi il valore predittivo negativo del test.

176
Soggetti a basso rischio NPV = P (M | T −) = ≅ 0.994
177
113
Soggetti a medio rischio NPV = P (M | T −) = ≅ 0.942
120
8
Soggetti ad alto rischio NPV = P (M | T −) = = 0.8
10
297
Soggetti totali NPV = P ( M | T −) = ≅ 0.967
307

Si può concludere che in soggetti a bassa probabilità pre-test, la negatività del D-Dimero test è in grado
di escludere quasi certamente la presenza di un episodio di trombosi venosa profonda.

21
Spectrum Bias: un problema nella valutazione dei test diagnostici
Nel paragrafo precedente abbiamo considerato specificità e sensibilità come caratteristiche intrinseche di
un test. La pratica clinica dimostra che, in realtà, molti test diagnostici hanno una affidabilità diversa a
seconda della sottopopolazione cui vengono somministrati (spectrum bias).
Riportiamo alcuni esempi10 di test diagnostici con diversa affidabilità in corrispondenza di particolari
sottopopolazioni.

Tab.8
Test Gold Standard Sottogruppi Sensibilità Specificità
(%) (%)
angina tipica 79.6 80.9
angina atipica 52.8 82.7
ECG sotto sforzo
Cateterismo uomini 72.4 83.1
per ischemia
cardiaco donne 57.2 85.9
coronarica
età < 40 anni 56.2 83.7
età > 60 anni 84.4 70.0

CEA screening per Duke A o B 36 87


Biopsia
cancro al colon Duke C o D 74 83

ECG per diagnosi età < 50 anni 3.4 83


di ipertrofia età > 70 anni 13.9 99.5
Ecocardiografia
ventricolare obesi 5.7 98.9
sinistra non obesi 14.2 98.3

Appare dunque evidente, nella valutazione e nell’uso di un test diagnostico, la necessità di porre attenzione
al gruppo a cui il test viene somministrato. In genere non si registreranno rilevanti disparità tra i valori di
sensibilità e specificità dichiarati in letteratura e quelli trovati nella pratica clinica se i gruppi esaminati
hanno caratteristiche omogenee rispetto al campione sperimentale. Se invece i pazienti reclutati per i trial
non sono rappresentativi della popolazione sottoposta usualmente al test nella pratica clinica, i valori di
sensibilità e specificità dichiarati non saranno confermati e quindi non potranno essere utilizzati. Il
problema è tanto più importante in quanto in molti trial vengono arruolati soggetti con severe
manifestazioni cliniche di malattia, ciò che non capita frequentemente nella pratica clinica. Non deve
meravigliare quindi che un test possa essere estremamente affidabile quando utilizzato in ambito
ospedaliero e largamente inefficace quando utilizzato in un contesto ambulatoriale.

Riportiamo nel seguito, attraverso un esempio,10 il modo in cui valutare un test sensibile allo spectrum
bias, allorché esso venga somministrato a gruppi con differenti manifestazioni cliniche della malattia.
Il test preso in considerazione è un test rapido per la diagnosi di infezione del tratto urinario (ITU). Il gold
standard è l’esame culturale delle urine.

La Tab.9 riporta il comportamento del test nella popolazione generale, costituita da 366 pazienti adulti.

Tab.9
Urinocultura
positiva negativa totali
T+ 60 84 144
T- 12 210 222
totali 72 294 366

Considerando la globalità dei soggetti, le caratteristiche del test sono le seguenti:


SENS = 60 72 ≅ 0.83
22
SPEC = 210 294 ≅ 0.71

La Tab. 10 riporta il comportamento del test riscontrato in due gruppi caratterizzati rispettivamente da
elevata e bassa probabilità a priori di malattia (valutata su basi cliniche).

Tab.10
Soggetti ad alto rischio (P > 50%) Soggetti a basso rischio (P < 50%)
Urinocultura Urinocultura
Positiva Negativa Totali Positiva Negativa Totali
T+ 50 31 81 T+ 10 53 63
T– 4 22 26 T– 8 188 196
Totali 54 53 107 Totali 18 241 259

I valori di sensibilità e specificità nei due gruppi, che indicheremo con indici A (alto rischio) e B (basso
rischio), sono notevolmente diversi:
SENS A = 50 54 ≅ 0.93 SENS B = 10 18 ≅ 0.56
SPEC A = 22 53 ≅ 0.42 SPECB = 188 241 ≅ 0.78

Nei 107 soggetti con alta probabilità a priori di ITU, la sensibilità del test è molto buona, mentre nei 259
soggetti con bassa probabilità a priori di ITU, la sensibilità del test è molto scarsa. Ne consegue che,
nell’applicazione del test, occorre prestare molta attenzione alla tipologia di popolazione cui viene
somministrato.
In questo esempio, come osservato in precedenza, ci aspettiamo che il test sia affidabile quando usato in
ambito ospedaliero – dove presumibilmente prevarranno soggetti ad alto rischio di ITU – ma poco
affidabile in ambito ambulatoriale – dove presumibilmente prevarranno soggetti a basso rischio.

La sensibilità (specificità) di una generica popolazione si calcola come media pesata della sensibilità
(specificità) dei vari sottogruppi dove i pesi sono le rispettive frazioni di malati (sani) del sottogruppo
rispetto al totale dei malati (sani) della popolazione.
M M
Se ei ≡ i e g i ≡ i sono rispettivamente le frazioni di malati e sani del gruppo i-esimo si ha dunque:
M M
SENS =  SENSi ⋅ ei SPEC =  SPECi ⋅ g i (1.24)

Nell’esempio esaminato, in cui si tratta di due soli sottogruppi, si ha e1 = 54 72 , e2 = 1 − e1 = 38 72 ,


g1 = 53 294 , g 2 = 1 − g1 = 241 294

Supponiamo ora di sottoporre a test rapido per la diagnosi di ITU una popolazione in cui presumibilmente
la frazione di malati appartenenti al gruppo ad alto rischio sia del 10%. Vogliamo determinare in questo
contesto quale sarà la sensibilità del test.
In questo caso eA = 0.1 e quindi la sensibilità vale
SENS = SENS B + eA ⋅ ( SENS A − SENS B ) = 0.56 + 0.1 ⋅ (0.93 − 0.56) ≅ 0.6

23
Esempio 8

Riprendiamo i dati riportati in Tab.7 e calcoliamo SENS, SPEC, e, g nei gruppi caratterizzati da rischio
alto (A), medio (M), basso (B). I valori sono riportati in Tab.11

Tab.11
SENS SPEC e g
B 4/5 176/201 5/64 201/381
M 17/24 113/164 24/64 164/381
A 33/35 8/16 35/64 16/381

E’ facile verificare che SENS e SPEC nella popolazione intera valgono rispettivamente:
SENS = 54 64 e SPEC = 297 381 in accordo con la (1.24)

Confronto di Sensibilità e Specificità di due Test Diagnostici applicati sul medesimo gruppo di
soggetti
Nel confronto di sensibilità e specificità, nel caso di due test diagnostici sottoposti al medesimo gruppo di
soggetti, ci troveremo a valutare delle differenze di proporzioni (sensibilità e specificità) su campioni
appaiati. Non potremo pertanto far uso degli stessi metodi utilizzati nell’ Esempio 4. Affronteremo il
problema nell’Esempio 9 di seguito proposto.

Esempio 9
Un campione di 200 individui è stato esaminato con due procedure (CT e US) atte a individuare la
presenza o l’assenza di una certa malattia11. La Tab. 12 riassume i risultati delle procedure.
Tab.12

M M M M
+ 52 11 63 + 64 14 78
CT US
− 37 100 137 − 25 97 122
89 111 200 89 111 200
Quindi

SENSCT = 0.58 SPECCT = 0.90


SENSUS = 0.72 SPECUS = 0.87

I risultati mostrano che CT ha una specificità superiore a US, mentre US ha una sensibilità superiore a CT.
Si tratta di risultati ottenuti su un gruppo di soggetti, per rendere questi risultati generalizzabili dobbiamo
implementare un processo inferenziale. Dobbiamo riorganizzare i risultati come riportato in Tab. 13 e
valutare le significatività statistiche delle differenze applicando i test per proporzioni correlate.
Tab. 13a Matched sample table for 89 Tab.13b Matched sample table for 111 non-
diseased individuals diseased individuals
CT+ CT- CT+ CT-
US+ 40 24 64 US+ 4 10 14
US- 12 13 25 US- 7 90 97
52 37 89 11 100 111

24
Tab. 14 The matched sample table for diseased (a) and non-diseased (b) patient group as verified by final
diagnosis (gold standard).

Tab. 14a Matched sample table for 89 Tab.14b Matched sample table for 111 non-
diseased individuals diseased individuals
CT+ CT- CT+ CT-
US+ a c a+c US+ e g e+g
US- b d b+d US- f h f+h
a+b c+d a+b+c+d e+f g+h e+g+f+h

Nelle tabelle 14a e 14b le coppie a–d nonchè e–h sono dette coppie concordanti e non possono contribuire
a valutare la differenza di performance dei due test. Le uniche coppie che contribuiscono alla valutazione
di una eventuale differenza di performance sono quelle discordanti ossia le coppie b–c e f–g.

Considerato che le coppie b–c e f–g , sotto ipotesi nulla che i due test non differiscano nella loro
performance, possono essere considerate come il risultato di eventi binomiali con probabilità π = 0.5 si
ottiene:

b+c
b − E (b) b−
( b − c) / 2 ( b − c)
2
2 b−c
Z= = = = →Z =X =
2 2
∼ χ12
var ( b ) π (1 − π )( b + c ) 0.25 ( b + c ) b+c b+c
(1.25)
(f − g)
2

X2 = ∼ χ12
f +g

Questo test prende il nome di test di Mc Nemar e, come il test del χ 2 , ha valore asintotico.

Nel caso di numerosità troppo esigua (sample size inferiore a 20)12, si preferisce usare il test esatto che di
seguito proponiamo:

m = b + c k = min ( b, c )
m
k
m  1  m m!
p = 2      =  (1.26)
j =0  j   2   j  j !( m − j )! m = f + g k = min ( f , g )

Adesso utilizzeremo i dati numerici di Tab.13 per testare la presenza di differenze statisticamente
significative, nei due test, tra SENS e SPEC.

Test sulle differenze

SENS SPEC
b−c f −g
Z= = 2 → P = 0.0455 Z= = 0.728 → P = 0.467
b+c f +g
(b − c )
2
(f − g)
2
X2 = = 4 → P = 0.0455 X2 = = 0.529 → P = 0.467
b+c f +g
m
k
 m  1 
p = 2    = 0.0652
m
k
m  1 
j =0  j   2 
p = 2    = 0.629
j =0  j   2 

25
Intervalli di confidenza delle differenze
. mc_nemi 40 24 \12 13,1

Option 1
ONLY DISEASED PATIENTS -> SENSITIVITY

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 40 24 | 64
2 | 12 13 | 25
-----------+----------------------+----------
Total | 52 37 | 89

------------------------------------------------------------
Comparison of Paired Test Results
Probability exact test .06524534
Probability chi-square test .04550026
------------------------------------------------------------

SENS1= .5843
SENS2= .7191

---------------------------------------------
CI(95%) Wilson -.25875963 *** -.00452766
CI(95%) Newcombe -.2605064 *** -.00263901
CI(95%) Wald -.26396284 *** -.00570009
---------------------------------------------

. mc_nemi 4 10\7 90,2


Option 2
ONLY NON DISEASED PATIENTS -> SPECIFICITY

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 4 10 | 14
2 | 7 90 | 97
-----------+----------------------+----------
Total | 11 100 | 111

------------------------------------------------------------
Comparison of Paired Test Results
Probability exact test .62905884
Probability chi-square test .46685427
Because the number of patients with differing test results
is small (<20), using the exact test will be better!!!
------------------------------------------------------------

SPEC1= .9009
SPEC2= .8739

---------------------------------------------
CI(95%) Wilson -.04825956 *** .10365673
CI(95%) Newcombe -.05031151 *** .10552611
CI(95%) Wald -.04560353 *** .09965759
---------------------------------------------

26
Tab. 15 Confidence interval estimation of the difference between sensitivities and
specificities of two diagnostic procedures performed on the same group of patients
Sensitivity Specificity
SENSCT = 0.58 SENSUS = 0.72 SPECCT = 0.90 SPECUS = 0.87
Method CI(95%) CI(95%)
Wilson -0.259 -0.0045 -0.048 0.104
∆SENS = −0.14 ∆SPEC = 0.03
Newcombe -0.261 -0.0026 -0.050 0.105
Wald -0.263 -0.006 -0.046 0.100

Overall Test of significance if BOTH sensitivities and specificities.a

CT
US
TP FP FN TN
TP same 24
FP same 10
FN 12 same
TN 7 same

CT
US
TP FP FN TN
TP same c
FP same g
FN a same
TN f same

Il test omnibus considera i test globalmente tenendo conto sia di sensibilità, sia di specificità.
Trattandosi di dati appaiati la relativa tabella si esamina con il test di Mc Nemar con due gradi di
libertà.

Con riferimento al nostro esempio avremo:

(c − a ) (g − f ) ( 24 − 12 ) (10 − 7 )
2 2 2 2

X2 = + = + = 4.53 ∼ χ 22 → P = 0.104
c+a g+ f 24 + 12 10 + 7

Quindi, globalmente, ossia considerando sia la sensibilità, sia la specificità, non ci sono elementi per
affermare che i due test siano staticamente differenti (P=0.104)

a Questo test è analogo all’F-test utilizzato nell’analisi della varianza e viene utilizzato per controllare l’errore tipo I
27
Rielaboriamo il file globale (comprensivo di malati e non malati) con l’ado file pairtest

1. Si determinano Sensibilità, Specificità, PPV, NPV, LR+, LR- e Youden’s Index di entrambi i
test e i corrispondenti intervalli di confidenza (Wald, Exact and Wilson Method)
2. Si conduce un test omnibus (Mc Nemat test con due gradi di libertà) riscostruendo la Omnibus
Matrix
3. Si testano le differenze tra le sensibilità e le specificità, tenendo conto che i risultati dei test NON
sono indipendenti (Z test, Mc Nemar test and Exact test)
4. Si determinano gli intervalli di confidenza delle differenze tra le sensibilità e le specificità
(Wilson, Newcombe and Wald)
. sysuse hawass,clear
. pairtest T1 T2 M
First Test

| Test1
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 100 11 | 111
1 | 37 52 | 89
-----------+----------------------+----------
Total | 137 63 | 200

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.584 0.482 0.687 0.475 0.688 0.480 0.681
SPEC 0.901 0.845 0.956 0.830 0.949 0.831 0.944
PPV 0.825 0.732 0.919 0.709 0.909 0.714 0.900
NPV 0.730 0.656 0.804 0.647 0.802 0.650 0.797
LR+ 5.896 3.276 10.611
LR- 0.461 0.358 0.595
----------------------------------------------------------------------

Youden index = 0.485 95%CI ( 0.369- 0.602) Normal Approximation


95%CI ( 0.373- 0.604) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

Second test

| Test2
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 97 14 | 111
1 | 25 64 | 89
-----------+----------------------+----------
Total | 122 78 | 200

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.719 0.626 0.812 0.614 0.809 0.618 0.802
SPEC 0.874 0.812 0.936 0.797 0.929 0.799 0.923
PPV 0.821 0.735 0.906 0.717 0.898 0.721 0.890
NPV 0.795 0.723 0.867 0.713 0.863 0.715 0.857
LR+ 5.701 3.435 9.462
LR- 0.321 0.229 0.452
----------------------------------------------------------------------

Youden index = 0.593 95%CI ( 0.481- 0.705) Normal Approximation


95%CI ( 0.481- 0.704) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

28
COMPARISON RESULTS

OMNIBUS MATRIX
FIRST TEST
SECOND TEST TP FP FN TN
----------------------------------------
TP 13 NA 24 NA
FP NA 90 NA 10
FN 12 NA 40 NA
TN NA 7 NA 4
----------------------------------------
Overall test of significance for both the sensitivities
and specificities of the two procedures
Mc Nemar chi(2) = 4.5294118
Probability = .10386058

Comparison of sensitivities of the two methods


--------------------------------------------------
Comparison of Paired Test Results
Probability exact test .06524534
Probability chi-square test .04550026
CI(95) T1-T2

--------------------------------------------------
CI(95%) Wilson -.25875963 - -.00452766
CI(95%) Newcombe -.2605064 - -.00263901
CI(95%) Wald -.26396284 - -.00570009
--------------------------------------------------

Comparison of specificities of the two methods


--------------------------------------------------
Comparison of Paired Test Results
Probability exact test .62905884
Probability chi-square test .46685427
Because the number of patients with differing
test results is small (<20), using the exact test will be better!!!
CI(95) T1-T2

--------------------------------------------------
CI(95%) Wilson -.04825956 - .10365673
CI(95%) Newcombe -.05031151 - .10552611
CI(95%) Wald -.04560353 - .09965759
--------------------------------------------------

29
Esempio 10
Le tabelle sotto riportate riassumono i risultati di uno studio13 avente lo scopo di confrontare tre test per
la determinazione del sangue occulto come indice di presenza di neoplasia colorettale (polipi adenomatosi
e/o carcinoma colorettale)

1. Calcoleremo sensibilità, specificità, PPV, NPV, LR+, LR-, Youden’s Index , nonché i
corrispondenti intervalli di confidenza, dei tre test.
2. Valuteremo per ogni coppia a confronto (HOII vs MH; BMCA vs MH) il relativo omnibus test
3. Effettueremo, per ogni coppia a confronto, gli opportuni test statistici per valutare la presenza
di differenze significative
4. Calcoleremo gli intervalli di confidenza delle differenze tra le sensibilità e le specificità delle due
coppie di test a confronto.

PUNTO 1

BMCA (Table IV e V)
Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson

SENS 0.250 0.038 0.462 0.073 0.524 0.102 0.495


SPEC 0.891 0.828 0.955 0.809 0.947 0.811 0.940
PPV 0.286 0.049 0.522 0.084 0.581 0.117 0.546
NPV 0.872 0.805 0.940 0.788 0.932 0.790 0.925
LR+ 2.300 0.820 6.448
LR- 0.841 0.629 1.127
Youden index = 0.141 95%CI (-0.080 - 0.363) Normal Approximation
95%CI (-0.015 - 0.399) Wilson's Approximation

30
MH (Table IV and V)
Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson
SENS 0.438 0.194 0.681 0.198 0.701 0.231 0.668
SPEC 0.946 0.899 0.992 0.878 0.982 0.879 0.977
PPV 0.583 0.304 0.862 0.277 0.848 0.320 0.807
NPV 0.906 0.848 0.965 0.829 0.956 0.831 0.950
LR+ 8.050 2.910 22.268
LR- 0.595 0.385 0.919
Youden index = 0.383 95%CI ( 0.136 - 0.631) Normal Approximation
95%CI ( 0.174 - 0.623) Wilson's Approximation

MH (Table II and III)


Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson
SENS 0.583 0.386 0.781 0.366 0.779 0.388 0.755
SPEC 0.963 0.932 0.995 0.916 0.988 0.917 0.984
PPV 0.737 0.539 0.935 0.488 0.909 0.512 0.882
NPV 0.929 0.887 0.971 0.873 0.965 0.874 0.961
LR+ 15.867 6.296 39.987
LR- 0.433 0.269 0.695
Youden index = 0.547 95%CI ( 0.347 - 0.746) Normal Approximation
95%CI ( 0.350 - 0.725) Wilson's Approximation

OHII (Table II and III)


Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson
SENS 0.375 0.181 0.569 0.188 0.594 0.212 0.573
SPEC 0.868 0.811 0.925 0.799 0.920 0.800 0.915
PPV 0.333 0.156 0.511 0.165 0.540 0.186 0.522
NPV 0.887 0.833 0.941 0.821 0.935 0.822 0.930
LR+ 2.833 1.447 5.550
LR- 0.720 0.525 0.989
Youden index = 0.243 95%CI ( 0.041 - 0.445) Normal Approximation
95%CI ( 0.073 - 0.452) Wilson's Approximation

31
PUNTO 2
MH
TP FP FN TN
TP 8 NA 1 NA
BMCA FP NA 79 NA 8
FN 4 NA 3 NA
TN NA 3 NA 2

Overall test of significance for both the sensitivities and specificities of the two procedures
Mc Nemar chi(2) = 4.0727273
Probability = .1305024

MH

TP FP FN TN
TP 9 NA 4 NA
HOII FP NA 116 NA 15
FN 9 NA 5 NA
TN NA 2 NA 3

Overall test of significance for both the sensitivities and specificities of the two procedures
Mc Nemar chi(2) = 11.864253
Probability = .00265283

PUNTO 3

Test Sensitivities Specificities


χ2
1
0.165 0.0016
MH vs HOII
Fisher’s Exact 0.267 0.0023

χ12 0.179 0.132


MH vs BMCA
Fisher’s Exact 0.375 0.226

Because the number of patients with differing test results is small (<20)
using the exact test will be better!!!

32
PUNTO 4

HOII vs MH

SENSHOII = 0.375 SENSMH = 0.583 ∆SENSHOIIvsMH = -0.208

CI95% ( ∆SENSHOIIvsMH )

Method LL UL
Wilson -.45069107 .07548941
Newcombe -.45069107 .07548941
Wald -.49074339 *** .07407672

SPECHOII = 0.868 SPECMH = 0.963 ∆SPECHOIIvsMH = -0.095

CI95% ( ∆SPECHOIIvsMH )
Method LL UL
Wilson -.1603308 *** -.03915582
Newcombe -.16157256 *** -.03697116
Wald -.1527965 *** -.03837997

BMCA vs MH

SENSBMCA = 0.25 SENSMH = 0.4375 ∆SENSHOIIvsMH = -0.1875

CI95% ( ∆SENSBMCAvsMH )
Method LL UL
Wilson -.41182184 *** .06914427
Newcombe -.43299448 *** .09637842
Wald -.44555084 *** .07055084

SPECBMCA = 0.8913 SPECMH = 0.9457 ∆SPECHOIIvsMH = -0.0544

CI95% ( ∆SPECBMCAvsMH )

Method LL UL
Wilson -.13332696 *** .01878051
Newcombe -.1357013 *** .0221138
Wald -.12412814 *** .01543249

33
Di seguito riportiamo gli STATA output.

Table II
. mc_nemi 5 9\4 6,1
Option 1
ONLY DISEASED PATIENTS -> SENSITIVITY

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 5 9 | 14
2 | 4 6 | 10
-----------+----------------------+----------
Total | 9 15 | 24

------------------------------------------------------------
Comparison of Paired Test Results
Probability exact test .2668457
Probability chi-square test .16551786
Because the number of patients with differing test results
is small (<20), using the exact test will be better!!!
------------------------------------------------------------

SENS1= .375
SENS2= .5833

---------------------------------------------
CI(95%) Wilson -.45069107 .07548941
CI(95%) Newcombe -.45069107 .07548941
CI(95%) Wald -.49074339 .07407672
---------------------------------------------

Table III

. mc_nemi 3 2 \ 15 116,2
Option 2
ONLY NON DISEASED PATIENTS -> SPECIFICITY

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 3 2 | 5
2 | 15 116 | 131
-----------+----------------------+----------
Total | 18 118 | 136

------------------------------------------------------------
Comparison of Paired Test Results
Probability exact test .00234985
Probability chi-square test .00161622
Because the number of patients with differing test results
is small (<20), using the exact test will be better!!!
------------------------------------------------------------

SPEC1= .8676
SPEC2= .9632

---------------------------------------------
CI(95%) Wilson -.1603308 -.03915582
CI(95%) Newcombe -.16157256 -.03697116
CI(95%) Wald -.1527965 -.03837997
---------------------------------------------

34
Table (II and III)

. pairtest MH HOII D
First Test

| Test1
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 131 5 | 136
1 | 10 14 | 24
-----------+----------------------+----------
Total | 141 19 | 160

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.583 0.386 0.781 0.366 0.779 0.388 0.755
SPEC 0.963 0.932 0.995 0.916 0.988 0.917 0.984
PPV 0.737 0.539 0.935 0.488 0.909 0.512 0.882
NPV 0.929 0.887 0.971 0.873 0.965 0.874 0.961
LR+ 15.867 6.296 39.987
LR- 0.433 0.269 0.695
----------------------------------------------------------------------

Youden index = 0.547 95%CI ( 0.347- 0.746) Normal Approximation


95%CI ( 0.350- 0.725) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

Second test

| Test2
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 118 18 | 136
1 | 15 9 | 24
-----------+----------------------+----------
Total | 133 27 | 160

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.375 0.181 0.569 0.188 0.594 0.212 0.573
SPEC 0.868 0.811 0.925 0.799 0.920 0.800 0.915
PPV 0.333 0.156 0.511 0.165 0.540 0.186 0.522
NPV 0.887 0.833 0.941 0.821 0.935 0.822 0.930
LR+ 2.833 1.447 5.550
LR- 0.720 0.525 0.989
----------------------------------------------------------------------

Youden index = 0.243 95%CI ( 0.041- 0.445) Normal Approximation


95%CI ( 0.073- 0.452) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

COMPARISON RESULTS

OMNIBUS MATRIX
FIRST TEST
SECOND TEST TP FP FN TN
----------------------------------------
TP 6 NA 4 NA
FP NA 116 NA 15
FN 9 NA 5 NA
TN NA 2 NA 3
----------------------------------------
Overall test of significance for both the sensitivities
and specificities of the two procedures
Mc Nemar chi(2) = 11.864253
Probability = .00265283

35
Su un piano ROC, dove sulle ascisse si pone (1-SPEC) e sulle ordinate la SENS, è facile individuare un
punto A, le cui coordinate permettono di risalire alla SENS e alla SPEC del test stesso, nonché i rapporti
di verosimiglianza LR+ e LR–.7
Si consideri ad esempio un test A di SENS = 0.7 e SPEC = 0.6. Sul piano ROC sarà rappresentato con un
punto A di coordinate (0.7; 0.4). Dalla (1.19) è facile riconoscere che il luogo dei punti LR+ = 0.7/0.4 è
una retta che passa per A avente un coefficiente angolare m = tan α = SENS / (1 − SPEC ) .a
Dalla (1.20) per contro è facile riconoscere che il luogo dei punti con LR– = 03/0.6 è una retta che passa
per il punto A e avente un coefficiente angolare m = tan β = (1 − SENS) / SPEC .b

Fig.4 Rappresentazione sul piano ROC di un test con SENS = 0.7 e SPEC = 0.6

Fig. 5 Rappresentazione sul piano ROC di DUE test:


Test A (SENS = 0.7, SPEC = 0.6) ; Test B (SENS = 0.8, SPEC = 0.75)

a Tale retta passa anche per il punto (0; 0)


b Tale retta passa anche per il punto (1,1)
19
Table V
. mc_nemi 2 3 \ 8 79,2
Option 2
ONLY NON DISEASED PATIENTS -> SPECIFICITY

| col
row | 1 2 | Total
-----------+----------------------+----------
1 | 2 3 | 5
2 | 8 79 | 87
-----------+----------------------+----------
Total | 10 82 | 92

------------------------------------------------------------
Comparison of Paired Test Results
Probability exact test .2265625
Probability chi-square test .13166802
Because the number of patients with differing test results
is small (<20), using the exact test will be better!!!
------------------------------------------------------------

SPEC1= .8913
SPEC2= .9457

---------------------------------------------
CI(95%) Wilson -.13332696 .01878051
CI(95%) Newcombe -.1357013 .0221138
CI(95%) Wald -.12412814 .01543249
---------------------------------------------

Table (IV and V)

. pairtest MH BMCA D
First Test

| Test1
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 87 5 | 92
1 | 9 7 | 16
-----------+----------------------+----------
Total | 96 12 | 108

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.438 0.194 0.681 0.198 0.701 0.231 0.668
SPEC 0.946 0.899 0.992 0.878 0.982 0.879 0.977
PPV 0.583 0.304 0.862 0.277 0.848 0.320 0.807
NPV 0.906 0.848 0.965 0.829 0.956 0.831 0.950
LR+ 8.050 2.910 22.268
LR- 0.595 0.385 0.919
----------------------------------------------------------------------

Youden index = 0.383 95%CI ( 0.136- 0.631) Normal Approximation


95%CI ( 0.174- 0.623) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

Second test

| Test2
Condition | 0 1 | Total
-----------+----------------------+----------
0 | 82 10 | 92
1 | 12 4 | 16
-----------+----------------------+----------
Total | 94 14 | 108

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.250 0.038 0.462 0.073 0.524 0.102 0.495
SPEC 0.891 0.828 0.955 0.809 0.947 0.811 0.940
PPV 0.286 0.049 0.522 0.084 0.581 0.117 0.546
NPV 0.872 0.805 0.940 0.788 0.932 0.790 0.925
LR+ 2.300 0.820 6.448
LR- 0.841 0.629 1.127
----------------------------------------------------------------------

37
Youden index = 0.141 95%CI (-0.080- 0.363) Normal Approximation
95%CI (-0.015- 0.399) Wilson's Approximation
Condition (0 healty) (1 sick); Test (0 negative) (1 positive)

COMPARISON RESULTS

OMNIBUS MATRIX
FIRST TEST
SECOND TEST TP FP FN TN
----------------------------------------
TP 8 NA 1 NA
FP NA 79 NA 8
FN 4 NA 3 NA
TN NA 3 NA 2
----------------------------------------
Overall test of significance for both the sensitivities
and specificities of the two procedures
Mc Nemar chi(2) = 4.0727273
Probability = .1305024

Comparison of sensitivities of the two methods


--------------------------------------------------
Comparison of Paired Test Results
Probability exact test .375
Probability chi-square test .17971249
Because the number of patients with differing
test results is small (<20), using the exact test will be better!!!
CI(95) T1-T2

--------------------------------------------------
CI(95%) Wilson -.06914427 .41182184
CI(95%) Newcombe -.09637842 .43299448
CI(95%) Wald -.07055084 .44555084
--------------------------------------------------

Comparison of specificities of the two methods


--------------------------------------------------
Comparison of Paired Test Results
Probability exact test .2265625
Probability chi-square test .13166802
Because the number of patients with differing
test results is small (<20), using the exact test will be better!!!
CI(95) T1-T2

--------------------------------------------------
CI(95%) Wilson -.01878051 .13332696
CI(95%) Newcombe -.0221138 .1357013
CI(95%) Wald -.01543249 .12412814
--------------------------------------------------

38
Esempio 5

Un soggetto ha a priori una probabilità di malattia pari al 60% e risulta positivo ad un test diagnostico di
SENS = 0.94 e di SPEC = 0.92. Determinare la probabilità a posteriori di malattia.

P( M ) 0.6
odds a priori = = = 1.5
1 − ( P ( M )) 0.4
SENS 0.94
LR+ = = = 11.75
1 − SPEC 0.08

odds a posteriori = 1.5 ⋅11.75 = 17.625

odds 17.625
P(M | T +) = = ≅ 0.946
1 + odds 18.625

Esempio 6

Mostriamo la valutazione di una procedura diagnostica8


I soggetti esaminati sono 1000. Valutiamo il grado di affidabilità dell’esame fisico condotto allo scopo di
identificare la presenza di una frattura, che sarà confermata o meno da esame radiologico. L’esame
radiologico è da ritenersi il gold standard ovvero il test di riferimento. I risultati sono mostrati in Tab.6.

Tab. 6
risultati radiologici
esame fisico Positivi (frattura) Negativi (no frattura) Totali
Positivo (frattura) 190 80 270
Negativo (no frattura) 10 720 730
Totali 200 800 1000

P (TP) 190 P (TN) 720


SENS = = = 0.95 SPEC = = = 0.90
P (M ) 200 P (M ) 800

190 720
PPV = P (M | T + ) = ≅ 0.70 NPV = P (M | T −) = ≅ 0.99
270 730

SENS 1 − SENS
LR + = = 9.5 LR − = ≅ 0.06
1 − SPEC SPEC

190 10
OR = = 171
80 720

20
Interpretazione AND

La SENS del test combinato sarà sempre inferiore alla sensibilità del singolo test
La SPEC del test combinato sarà sempre superiore alla specificità del test singolo

Considerato un Test A, l’aggiunta seriale di un test B (con interpretazione AND) il punto di lavoro, nel
piano ROC, del test combinato C si può collocare esclusivamente all’interno del rettangolo ACEF.
All’interno di tale rettangolo si riconoscono tre aree.

Area ACD: all’interno di questa area il test combinato è senz’altro superiore al test singolo dato che
LR +C > LR + SINGLE LR −C < LR −SINGLE

Area AEF: all’interno di quest’area il test combinato è senz’altro inferiore al test singolo dato che
LR +C + < LR +SINGLE LR −C > LR −SINGLE

Area ADE: all’interno di tale area non è possibile, sulla base dei soli LR, effettuare una chiara scelta tra
test singolo e test combinato.

40
Interpretazione OR

La SENS del test combinato sarà sempre superiore alla sensibilità del singolo test
La SPEC del test combinato sarà sempre inferiore alla specificità del test singolo

Considerato un Test A, l’aggiunta seriale di un test B (con interpretazione OR) il punto di lavoro, nel
piano ROC, del test combinato C si può collocare esclusivamente all’interno del rettangolo ACEF.
All’interno di tale rettangolo si riconoscono tre aree.

Area ACD: all’interno di questa area il test combinato è senz’altro superiore al test singolo dato che
LR +C > LR + SINGLE LR −C < LR −SINGLE

Area AEF: all’interno di quest’area il test combinato è senz’altro inferiore al test singolo dato che
LR +C + < LR +SINGLE LR −C > LR −SINGLE

Area ADE: all’interno di tale area non è possibile, sulla base dei soli LR, effettuare una chiara scelta tra
test singolo e test combinato.

E’ Utile l’Aggiunta di un secondo Test?


Per cercare di dare una risposta alla domanda dobbiamo preliminarmente ricavare le caratteristiche di
un singolo test facente parte di una coppia di test sottoposti ai medesimi soggetti.

Caratteristiche del Test Singolo


Consideriamo, al solito, due test A e B entrambi sottoposti a un campione di N individui di cui M malati
e NM non malati. Di seguito riportiamo le frequenza assolute, e le percentuali, dei risultati dei test:

Tab.17 NON MALATI (NM) MALATI (M)


(50900) (915)
B+ B- B+ B-
A+ 3500 1800 700 15
A- 1600 44000 130 70

41
Tab.18 NON MALATI MALATI
B+ B- B+ B-
A+ 0.068762 0.035363 0.765027 0.016393
A- 0.031434 0.86444# 0.142077 0.076503#
# 0.86444=44000/50900 0.076503=70/915

NON MALATI (NM) MALATI (M)


B+ B- B+ B-
− − + +
A+ p++ p+− p++ p+−
− − + +
A- p−+ p−− p−+ p−−

E’ facile verificare che:

700 + 15
SENSA = p+++ + p++− = 0.765027 + 0.016393 = 0.781 =
915
+ + 700 + 130
SENSB = p++ + p−+ = 0.765027 + 0.142077 = 0.907 =
915
(1.29)
− − 44000 + 1600
SPECA = p−− + p−+ = 0.86444 + 0.031434 = 0.896 =
50900
− − 44000 + 1800
SPECB = p−− + p+− = 0.86444 + 0.035363 = 0.900 =
50900

SENSA p+ + p+−
+
SENSB p+ + p−++
LRA+ = = ++
− −
LRB+ = = +−+ −
1 − SPECA p++ + p+− 1 − SPECB p+ + + p−+
+ +
1 − SENSA p−− + p−+ 1 − SENSA p−+− + p+−
+
LRA− = = − −
LRA− = = − −
SPECA p−− + p−+ SPECA p−− + p+−

Le componenti dei test, A e B, sono dette condizionalmente indipendenti se7:

p+++ = SENSA ⋅ SENSB p+−+ = (1 − SPECA )(1 − SPECB ) (1.30)

Maggiore è il mancato rispetto delle uguaglianze e maggiore sarà la dipendenza condizionale.

Caratteristiche del Test Combinato 7

I risultati della applicazione di un test combinato possono essere riassunti secondo lo schema di Tab.19 di
seguito riportata in cui si considera il test A come test principale e il test B come potenziale aggiunta.

Tab. 19 Probabilities of pairs of tests results for the single Test (A) and the
combined test using (a) A ∪ B and (b) A ∩ B rules
(a)
Test A MALATI NON MALATI
A∪ B A∪ B
+ π +
++
+
=p +p
++
+
+− π +
+− =0 π −
++

=p +p
++

+− π +−

=0
- π −+
+ +
= p−+ π −−
+ +
= p−− π −+
− −
= p−+ π −−
− −
= p−−
(b)
A∩ B A∩ B
+ γ ++
+ +
= p++ γ +−
+
= p++− γ ++
− −
= p++ γ +−

= p+−−
- 0 γ −−
+ +
= p−− +
+ p−+ 0 γ −−
− −
= p−− −
+ p−+

42
Interpretazione OR ( A ∪ B )
Con riferimento all’interpretazione OR, notiamo che due celle devono essere strutturalmente pari a zero.
Infatti, con riferimento all’interpretazione OR, sia π +−
+
, sia π +−

non possono che assumere valore nullo.
Con riferimento al test combinato, tenute presenti le (1.29) si ha:

+ + + +
SENSA∪ B = p++ + p+− + p−+ = SENSA + p−+
− − − − −
(1.31)
SPECA∪ B = p−− = p−− + p−+ − p−+ = SPECA − p−+

Dalle (1.31) si vede che un test combinato, con interpretazione OR, implicando un amento di Sensibilità e
contemporaneamente una diminuzione di Specificità rispetto al test singolo, ci indurrà sempre ad una
soluzione di compromesso. Di volta in volta dovremo decidere se l’aumento di Sensibilità (guadagno) sia
tale da compensare la diminuzione di Specificità (perdita).

Il confronto tra il test base e il test combinato può anche essere effettuato valutando gli scarti tra gli LR,
sia positivi, sia negativi e controllando la loro significatività statistica verificando se l’intervallo di
confidenza del loro rapporto comprenda o meno il valore 1.
Può essere utile allo scopo ricordare l’espressione della varianza della differenza dei logaritmi degli LR7

) − ln ( LRA+ ) = n πˆ + ππˆ−++ + πˆ + + n πˆ − ππˆ−+− + πˆ −


ˆ+ ˆ−
var ln ( LRAUB
+
(1.32)
D + + ( −+ ++ ) D ++ ( −+ ++ )

πˆ−+
+
πˆ−+

var ln ( LRAUB

) − ln ( LRA− ) = + (1.33)
nDπˆ (πˆ −+ + πˆ −− ) nDπˆ −− (πˆ −+
+
−−
+ + − −
+ πˆ −−

)
Interpretazione AND ( A ∩ B )
Con riferimento all’interpretazione AND, notiamo che due celle devono essere strutturalmente pari a
zero. Infatti, con riferimento all’interpretazione AND, sia π −+
+
, sia π −+

non possono che assumere valore
nullo.
Con riferimento al test combinato, tenute presenti le (1.29) si ha:
SENSA∩ B = p+++ = p++
+ +
+ p+− +
− p+− +
= SENSA − p+−
− − −
(1.34)
SPEC A∩ B = p−− + p−+ + p+− = SPECA + p+−−

Dalle (1.34) si vede che un test combinato, con interpretazione AND, implicando un amento di Specificità
e contemporaneamente una diminuzione di Sensibilità rispetto al test singolo, ci indurrà sempre ad una
soluzione di compromesso. Di volta in volta dovremo decidere se l’aumento di Specificità (guadagno) sia
tale da compensare la diminuzione di Sensibilità (perdita).

Volendo confrontare le due soluzioni test singolo vs test combinato tramite il confronto con gli LR, è utile
ricordare le seguenti espressioni delle varianze.
γˆ+−
+
γˆ+−−
var ln ( LRA+ ∩ B ) − ln ( LRA+ )  = + (1.35)
nDγˆ++
+
γˆ+−
+
(+ λˆ++
+
)
nDγˆ++

(γˆ+−− + γˆ++− )

γˆ+−
+
γˆ+−

var ln ( LRA− ∩ B ) − ln ( LRA− )  = + (1.36)
nDγˆ−−
+
(
γˆ+−
+
+ λˆ−−
+
) nDγˆ−−

(γˆ+−− + γˆ−−− )
Da quanto detto risulta evidente che comparare singolarmente le Sensibilità e le Specificità per mettere a
confronto il test combinato con il test singolo può essere fuorviante. Allo scopo sarebbe preferibile
utilizzare misure di performance (ad esempio LR + , LR − e il diagnostic OR) che siano funzione allo stesso
tempo di Sensibilità e Specificità.

43
Una scelta di compromesso: Test Singolo o Test Combinato?

In precedenza, abbiamo visto, come rappresentando le caratteristiche di un test su un piano ROC, si


possano facilmente individuare tre aree all’interno di due delle quali la scelta tra test singolo e test
combinato è chiara ed univoca. Tuttavia, c’è una terza area, un’area cosiddetta grigia, in cui una chiara
scelta non risulta fattibile. In questa area non si verificherà mai un simultaneo miglioramento di LR + e
LR − . In questo caso la decisione tra l’aggiunta o meno di un secondo test sarà influenzata dal grado di
compromesso che riterremo accettabile tra il numero atteso di falsi positivi addizionali rispetto al numero
negativi addizionali rispetto ai veri negativi addizionali (interpretazione AND).

Interpretazione OR ( A ∪ B )
I valori attesi addizionali dei veri positivi (TPA) e i valori attesi addizionali dei falsi positivi (FPA)
possono stimarsi con le (1.37):

TPA = π −+
+ +
= p−+ FPA = π −+
− −
= p−+ (1.37)

Se con R indichiamo il rapporto tra il numero di falsi positivi addizionali che siamo in grado di
sopportare in corrispondenza di ogni singolo vero positivo addizionale e con θ la prevalenza di malattia,
il valore di T, definito dalla (1.38) , potrà essere utilizzato come cut-off.

T = R ⋅ θ ⋅ π −+
+
− (1 − θ ) ⋅ π −+

(1.38)

se (T ) = R 2θ 2
π −+
+
(1 − π −++ ) + (1 − θ )
2 π −+

(1 − π −+− ) (1.39)
nM nM

T = 0 indica l’equivalenza dei due test: Test A equivalente a Test A ∪ B

T < 0 indica che è preferibile il test singolo

T > 0 indica che il il test combinato è preferibile

Esemplificazione

Supponiamo che:

1) R = 2; θ = 0.2; π −+
+
= 0.1; π −+

= 0.2

Allora

T = 2 ⋅ 0.2 + 0.10 − (1 − 0.20 ) ⋅ 0.20 = 0.04 − 0.16 = −0.12

E’ da preferire il singolo singolo

2) R = 8; θ = 0.2; π −+
+
= 0.1; π −+

= 0.2

T = 8 ⋅ 0.2 + 0.10 − (1 − 0.20 ) ⋅ 0.20 = 0.16 − 0.16 = 0

Test singolo e Test combinato paiono avere la stessa “utilità”

3) R = 8; θ = 0.3; π −+
+
= 0.1; π −+

= 0.2

T = 8 ⋅ 0.3 ⋅ 0.10 − (1 − 0.30 ) ⋅ 0.20 = 0.24 − 0.14 = 0.1

E’ da preferirsi il test combinato

44
Ponendo T =0 dalla (1.38) possiamo calcolare quel particolare valore di R, (R*) che renderebbe i due
test (singolo e combinato) interscambiabili.

(1 − θ ) π −+−
R* = (1.40)
θπ −+
+

Se l’R massimo tollerato fosse superiore a R* si opterebbe per il test combinato. Viceversa, se il valore
massimo di R tollerato fosse inferiore a R* si sceglierebbe il test singolo.

Utilizzando il delta method possiamo facilmente calcolare lo standard error asintotico di ln ( R* )

1−θ 
ln ( R * ) = ln   + ln (π − + ) − ln (π −+ )
+ −

 θ 
 1  π −+ (1 − π −+ )  1  π −+ (1 − π − + )
+ 2 + 2 − −

var ( R * ) = var  ln ( π −++ )  + var  ln (π −−+ )  =  +  + − 


 π −+  nM  π −+  nM

1 − π −+
+
1 − π −+

1 − π −+
+
1 − π −+

var ( R* ) = + → se ( ) π+ n π− n
R *
= + (1.41)
π −+
+
nM π −+ −
nM −+ M −+ M

Interpretazione AND ( A ∩ B )
I valori attesi addizionali dei veri positivi (TNA) e i valori attesi addizionali dei falsi negativi (FNA)
possono stimarsi con le (1.37):

TN A = π +−

= p+−− FN A = π +−
+ +
= p+− (1.42)

Se con R indichiamo il rapporto tra il numero di falsi negativi addizionali che siamo in grado di
sopportare in corrispondenza di ogni singolo vero negativo addizionale e con θ la prevalenza di malattia,
il valore di T, definito dalla (1.43), potrà essere utilizzato come cut-off

T = Rθπ ++− − (1 − θ ) π +−− (1.43)

se (T ) = R 2θ 2
π −+
+
(1 − π +−+ ) + (1 − θ )
2 π −+

(1 − π +−− ) (1.44)
nM nM

(1 − θ ) π +−−
R* = (1.45)
θπ +−
+

1 − π +−
+
1 − π +−

1 − π +−
+
1 − π +−

var ( R* ) = + → se ( R *
) = + (1.46)
π ++− nM π +−−
nM π +−
+
nM π +−− nM

Esempio 11

In Tab. 20 sono riassunti i dati di uno studio rivolto a una popolazione 364 donne sottoposte a colposcopia
per effetto di un Pap test anormale.7,14,15

Lo scopo dello studio consisteva nel verificare se l’aggiunta del test HPV, in combinazione con una ripetuta
analisi citologica (criterio OR), potesse essere utile dal punto di vista diagnostico.

45
Il risultato dell’HPV test è dicotomico (0 negativo; 1 positivo), mentre il Pap test fornisce la positività
graduata su tre valori (1-2-3; 0 test negativo):

1 ASUS (Atypical Squamous Cells of Undetermined Significance)


2 LSIL (Low grade Squamous Intraepithelial Lesion)
3 HSIL (High grade Squamous Intraepithelial Lesion)

Tab. 20 Cross-classified repeat cytologic (Pap) and HPV tests results within
categories of disease (n=364)
Disease M M=LSIL M=HSIL
Pap HPV+ HPV- HPV+ HPV- HPV+ HPV-
HSIL 2 2 2 1 28 12
LSIL 17 12 40 14 24 2
ASCUS 7 9 9 9 2 2
Normal 16 115 12 19 6 4
TOTAL 40 138 63 43 60 20

Si richiede di

1) Rappresentare su un piano ROC le performance diagnostiche della ripetizione del Pap Test, HPV Test
e il Test combinato P ∪ H per (a) disease=LSIL o HSIL; (b) disease=HSIL.

2) Rappresentare sempre su un piano ROC i likelihood ratio per il test singolo (Pap Test con risultato
dicotomico 0/1 (1=1,2,3) e il combinato P ∪ H quando: (a) disease=LSIL; (b) disease=HSIL.

Richiesta n.1

Riorganizziamo i dati di Tab.20

Tab. 21 Cross-classified repeat cytologic (Pap) and HPV tests results


P HPV M‡ W P HPV M# W
3 0 1 12 3 0 0 2
3 1 1 28 3 1 0 2
2 0 1 2 2 0 0 12
2 1 1 24 2 1 0 15
1 0 1 2 1 0 0 9
1 1 1 2 1 1 0 7
0 0 1 4 0 0 0 115
0 1 1 6 0 1 0 16
3 0 0 3 3 0 1 13
3 1 0 4 3 1 1 30
2 0 0 26 2 0 1 16
2 1 0 55 2 1 1 64
1 0 0 18 1 0 1 11
1 1 0 16 1 1 1 11
0 0 0 134 0 0 1 23
0 1 0 28 0 1 1 18
‡ M (disease) =HSIL # M(disease)= LSIL o HSIL

46
Calcoliamo SEN e SPEC considerando M = HSIL
use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_1.dta", clear
expand W
cls
gen t=0
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i'
diatest M t
}
*
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i' | HPV==1
diatest M t
}
t = 1 if P >= 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 162 122 | 284
1 | 10 70 | 80
-----------+----------------------+----------
Total | 172 192 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.875 0.803 0.947 0.782 0.938 0.785 0.931
SPEC 0.570 0.513 0.628 0.511 0.629 0.512 0.627
PPV 0.365 0.297 0.433 0.296 0.437 0.300 0.435
NPV 0.942 0.907 0.977 0.896 0.972 0.896 0.968
LR+ 2.037 1.740 2.384
LR- 0.219 0.122 0.395
----------------------------------------------------------------------

Youden index = 0.445 95%CI ( 0.353- 0.538) Normal Approximation


95%CI ( 0.339- 0.526) Wilson's Approximation
t = 1 if P >= 2

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 196 88 | 284
1 | 14 66 | 80
-----------+----------------------+----------
Total | 210 154 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.825 0.742 0.908 0.724 0.901 0.727 0.893
SPEC 0.690 0.636 0.744 0.633 0.743 0.634 0.741
PPV 0.429 0.350 0.507 0.349 0.511 0.353 0.508
NPV 0.933 0.900 0.967 0.891 0.963 0.891 0.960
LR+ 2.663 2.178 3.255
LR- 0.254 0.157 0.411
----------------------------------------------------------------------

Youden index = 0.515 95%CI ( 0.416- 0.614) Normal Approximation


95%CI ( 0.405- 0.603) Wilson's Approximation
t = 1 if P >= 3
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 277 7 | 284
1 | 40 40 | 80
-----------+----------------------+----------
Total | 317 47 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.500 0.390 0.610 0.386 0.614 0.393 0.607
SPEC 0.975 0.957 0.993 0.950 0.990 0.950 0.988
PPV 0.851 0.749 0.953 0.717 0.938 0.723 0.926
NPV 0.874 0.837 0.910 0.832 0.908 0.833 0.906
LR+ 20.286 9.452 43.539
47
LR- 0.513 0.411 0.639
----------------------------------------------------------------------

Youden index = 0.475 95%CI ( 0.364- 0.586) Normal Approximation


95%CI ( 0.368- 0.585) Wilson's Approximation

. *
. forvalues i=1(1)3{
2. replace t=0
3. replace t=1 if P>=`i' | HPV==1
4. diatest M t
5. }

t = 1 if P >= 1 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 134 150 | 284
1 | 4 76 | 80
-----------+----------------------+----------
Total | 138 226 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.950 0.902 0.998 0.877 0.986 0.878 0.980
SPEC 0.472 0.414 0.530 0.413 0.532 0.415 0.530
PPV 0.336 0.275 0.398 0.275 0.402 0.278 0.400
NPV 0.971 0.943 0.999 0.927 0.992 0.928 0.989
LR+ 1.799 1.594 2.030
LR- 0.106 0.040 0.278
----------------------------------------------------------------------

Youden index = 0.422 95%CI ( 0.347- 0.497) Normal Approximation


95%CI ( 0.330- 0.487) Wilson's Approximation
t = 1 if P >= 2 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 152 132 | 284
1 | 6 74 | 80
-----------+----------------------+----------
Total | 158 206 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.925 0.867 0.983 0.844 0.972 0.846 0.965
SPEC 0.535 0.477 0.593 0.475 0.594 0.477 0.592
PPV 0.359 0.294 0.425 0.294 0.429 0.297 0.427
NPV 0.962 0.932 0.992 0.919 0.986 0.920 0.982
LR+ 1.990 1.731 2.288
LR- 0.140 0.064 0.305
----------------------------------------------------------------------

Youden index = 0.460 95%CI ( 0.378- 0.542) Normal Approximation


95%CI ( 0.363- 0.531) Wilson's Approximation
t = 1 if P >= 3 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 178 106 | 284
1 | 8 72 | 80
-----------+----------------------+----------
Total | 186 178 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.900 0.834 0.966 0.812 0.956 0.815 0.948
SPEC 0.627 0.571 0.683 0.568 0.683 0.569 0.681
PPV 0.404 0.332 0.477 0.332 0.480 0.335 0.478
NPV 0.957 0.928 0.986 0.917 0.981 0.917 0.978
LR+ 2.411 2.039 2.851
LR- 0.160 0.082 0.310
----------------------------------------------------------------------

Youden index = 0.527 95%CI ( 0.440- 0.613) Normal Approximation


95%CI ( 0.426- 0.602) Wilson's Approximation

48
t = 1 if HPV = 1

. diatest M HPV

| HPV
M | 0 1 | Total
-----------+----------------------+----------
0 | 181 103 | 284
1 | 20 60 | 80
-----------+----------------------+----------
Total | 201 163 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.750 0.655 0.845 0.641 0.840 0.645 0.832
SPEC 0.637 0.581 0.693 0.578 0.693 0.580 0.691
PPV 0.368 0.294 0.442 0.294 0.447 0.298 0.444
NPV 0.900 0.859 0.942 0.851 0.938 0.851 0.935
LR+ 2.068 1.694 2.524
LR- 0.392 0.266 0.579
----------------------------------------------------------------------

Youden index = 0.387 95%CI ( 0.277- 0.497) Normal Approximation


95%CI ( 0.270- 0.487) Wilson's Approximation
Calcoliamo SEN e SPEC considerando M = HSIL oppure LSIL

use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_2.dta", clear


cls
gen t=0
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i'
diatest M t
}
*
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i' | HPV==1
diatest M t
}
t = 1 if P >= 1

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 131 47 | 178
1 | 41 145 | 186
-----------+----------------------+----------
Total | 172 192 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.780 0.720 0.839 0.713 0.837 0.715 0.833
SPEC 0.736 0.671 0.801 0.665 0.799 0.667 0.795
PPV 0.755 0.694 0.816 0.688 0.814 0.690 0.811
NPV 0.762 0.698 0.825 0.691 0.823 0.693 0.819
LR+ 2.952 2.284 3.817
LR- 0.300 0.225 0.398
----------------------------------------------------------------------

Youden index = 0.516 95%CI ( 0.428- 0.604) Normal Approximation


95%CI ( 0.428- 0.603) Wilson's Approximation
t = 1 if P >= 2

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 147 31 | 178
1 | 63 123 | 186
-----------+----------------------+----------
Total | 210 154 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


49
----------------------------------------------------------------------
SENS 0.661 0.593 0.729 0.588 0.729 0.591 0.725
SPEC 0.826 0.770 0.882 0.762 0.878 0.763 0.875
PPV 0.799 0.735 0.862 0.727 0.859 0.728 0.854
NPV 0.700 0.638 0.762 0.633 0.761 0.635 0.758
LR+ 3.797 2.713 5.314
LR- 0.410 0.332 0.507
----------------------------------------------------------------------

Youden index = 0.487 95%CI ( 0.399- 0.575) Normal Approximation


95%CI ( 0.401- 0.577) Wilson's Approximation
t = 1 if P >= 3
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 174 4 | 178
1 | 143 43 | 186
-----------+----------------------+----------
Total | 317 47 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.231 0.171 0.292 0.173 0.298 0.176 0.297
SPEC 0.978 0.956 0.999 0.943 0.994 0.944 0.991
PPV 0.915 0.835 0.995 0.796 0.976 0.801 0.966
NPV 0.549 0.494 0.604 0.492 0.605 0.494 0.603
LR+ 10.288 3.770 28.070
LR- 0.786 0.725 0.854
----------------------------------------------------------------------

Youden index = 0.209 95%CI ( 0.144- 0.273) Normal Approximation


95%CI ( 0.152- 0.283) Wilson's Approximation

. *
. forvalues i=1(1)3{
2. replace t=0
3. replace t=1 if P>=`i' | HPV==1
4. diatest M t
5. }
t = 1 if P >= 1 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 115 63 | 178
1 | 23 163 | 186
-----------+----------------------+----------
Total | 138 226 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.876 0.829 0.924 0.820 0.920 0.821 0.916
SPEC 0.646 0.576 0.716 0.571 0.716 0.573 0.713
PPV 0.721 0.663 0.780 0.658 0.779 0.659 0.776
NPV 0.833 0.771 0.896 0.760 0.891 0.762 0.886
LR+ 2.476 2.016 3.041
LR- 0.191 0.129 0.285
----------------------------------------------------------------------

Youden index = 0.522 95%CI ( 0.438- 0.607) Normal Approximation


95%CI ( 0.436- 0.605) Wilson's Approximation
t = 1 if P >= 2 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 124 54 | 178
1 | 34 152 | 186
-----------+----------------------+----------
Total | 158 206 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.817 0.762 0.873 0.754 0.870 0.755 0.866
SPEC 0.697 0.629 0.764 0.623 0.763 0.626 0.759
PPV 0.738 0.678 0.798 0.672 0.797 0.674 0.793
NPV 0.785 0.721 0.849 0.712 0.846 0.714 0.842
LR+ 2.694 2.134 3.400

50
LR- 0.262 0.191 0.361
----------------------------------------------------------------------

Youden index = 0.514 95%CI ( 0.426- 0.601) Normal Approximation


95%CI ( 0.426- 0.600) Wilson's Approximation
t = 1 if P >= 3 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 136 42 | 178
1 | 50 136 | 186
-----------+----------------------+----------
Total | 186 178 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.731 0.667 0.795 0.661 0.793 0.663 0.790
SPEC 0.764 0.702 0.826 0.695 0.824 0.697 0.820
PPV 0.764 0.702 0.826 0.695 0.824 0.697 0.820
NPV 0.731 0.667 0.795 0.661 0.793 0.663 0.790
LR+ 3.099 2.346 4.093
LR- 0.352 0.274 0.452
----------------------------------------------------------------------

Youden index = 0.495 95%CI ( 0.406- 0.584) Normal Approximation


95%CI ( 0.407- 0.585) Wilson's Approximation
t = 1 if HPV = 1
. diatest M HPV

| HPV
M | 0 1 | Total
-----------+----------------------+----------
0 | 138 40 | 178
1 | 63 123 | 186
-----------+----------------------+----------
Total | 201 163 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.661 0.593 0.729 0.588 0.729 0.591 0.725
SPEC 0.775 0.714 0.837 0.707 0.834 0.709 0.830
PPV 0.755 0.689 0.821 0.681 0.819 0.683 0.814
NPV 0.687 0.622 0.751 0.618 0.750 0.619 0.747
LR+ 2.943 2.198 3.939
LR- 0.437 0.352 0.542
----------------------------------------------------------------------

Youden index = 0.437 95%CI ( 0.345- 0.528) Normal Approximation


95%CI ( 0.347- 0.529) Wilson's Approximation

Tab. 22 Sensitivity and Specificity of repeat cytology (Pap), HPV and the combined test
P ∪ H for: (a) M (disease) = HSIL; (b) M (disease) = HSIL o LSIL

t = 1 if ....
SENS SPEC 1-SPEC SENS SPEC 1-SPEC
M = HSIL M=HSIL o LSIL
P ≥1 0.875 0.570 0.430 0.780 0.736 0.264
P≥2 0.825 0.690 0.310 0.661 0.826 0.174
P≥3 0.500 0.975 0.025 0.231 0.978 0.022
P ≥ 1 | HPV = 1 0.950 0.472 0.528 0.876 0.646 0.354
P ≥ 2 | HPV = 1 0.925 0.535 0.465 0.817 0.697 0.303
P ≥ 3 | HPV = 1 0.900 0.627 0.373 0.731 0.764 0.236
HPV = 1 0.750 0.637 0.363 0.661 0.775 0.225

51
Richiesta n.2

M (disease) = HSIL
use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_1.dta", clear
expand W
cls
replace t=1 if P>=1
diatest M t
replace t=0
replace t=1 if HPV==1
diatest M t
replace t=0
replace t=1 if P>=1 | HPV==1
diatest M t

. replace t=1 if P>=1


(192 real changes made)

. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 162 122 | 284
1 | 10 70 | 80
-----------+----------------------+----------
Total | 172 192 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.875 0.803 0.947 0.782 0.938 0.785 0.931
SPEC 0.570 0.513 0.628 0.511 0.629 0.512 0.627
PPV 0.365 0.297 0.433 0.296 0.437 0.300 0.435
NPV 0.942 0.907 0.977 0.896 0.972 0.896 0.968
LR+ 2.037 1.740 2.384
LR- 0.219 0.122 0.395
----------------------------------------------------------------------

Youden index = 0.445 95%CI ( 0.353- 0.538) Normal Approximation


95%CI ( 0.339- 0.526) Wilson's Approximation

52
. replace t=1 if HPV==1
(163 real changes made)

. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 181 103 | 284
1 | 20 60 | 80
-----------+----------------------+----------
Total | 201 163 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.750 0.655 0.845 0.641 0.840 0.645 0.832
SPEC 0.637 0.581 0.693 0.578 0.693 0.580 0.691
PPV 0.368 0.294 0.442 0.294 0.447 0.298 0.444
NPV 0.900 0.859 0.942 0.851 0.938 0.851 0.935
LR+ 2.068 1.694 2.524
LR- 0.392 0.266 0.579
----------------------------------------------------------------------

Youden index = 0.387 95%CI ( 0.277- 0.497) Normal Approximation


95%CI ( 0.270- 0.487) Wilson's Approximation

. replace t=1 if P>=1 | HPV==1


(226 real changes made)

. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 134 150 | 284
1 | 4 76 | 80
-----------+----------------------+----------
Total | 138 226 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.950 0.902 0.998 0.877 0.986 0.878 0.980
SPEC 0.472 0.414 0.530 0.413 0.532 0.415 0.530
PPV 0.336 0.275 0.398 0.275 0.402 0.278 0.400
NPV 0.971 0.943 0.999 0.927 0.992 0.928 0.989
LR+ 1.799 1.594 2.030
LR- 0.106 0.040 0.278
----------------------------------------------------------------------

Youden index = 0.422 95%CI ( 0.347- 0.497) Normal Approximation


95%CI ( 0.330- 0.487) Wilson's Approximation
M (disease) = HSIL or LSIL

use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_1.dta", clear


expand W
gen t=0
cls
replace t=1 if P>=1
diatest M t
replace t=0
replace t=1 if HPV==1
diatest M t
replace t=0
replace t=1 if P>=1 | HPV==1
diatest M t

. replace t=1 if P>=1


(192 real changes made)
. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 131 47 | 178
1 | 41 145 | 186
-----------+----------------------+----------
Total | 172 192 | 364
53
Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson
----------------------------------------------------------------------
SENS 0.780 0.720 0.839 0.713 0.837 0.715 0.833
SPEC 0.736 0.671 0.801 0.665 0.799 0.667 0.795
PPV 0.755 0.694 0.816 0.688 0.814 0.690 0.811
NPV 0.762 0.698 0.825 0.691 0.823 0.693 0.819
LR+ 2.952 2.284 3.817
LR- 0.300 0.225 0.398
----------------------------------------------------------------------

Youden index = 0.516 95%CI ( 0.428- 0.604) Normal Approximation


95%CI ( 0.428- 0.603) Wilson's Approximation

. replace t=0
(192 real changes made)

. replace t=1 if HPV==1


(163 real changes made)

. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 138 40 | 178
1 | 63 123 | 186
-----------+----------------------+----------
Total | 201 163 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.661 0.593 0.729 0.588 0.729 0.591 0.725
SPEC 0.775 0.714 0.837 0.707 0.834 0.709 0.830
PPV 0.755 0.689 0.821 0.681 0.819 0.683 0.814
NPV 0.687 0.622 0.751 0.618 0.750 0.619 0.747
LR+ 2.943 2.198 3.939
LR- 0.437 0.352 0.542
----------------------------------------------------------------------

Youden index = 0.437 95%CI ( 0.345- 0.528) Normal Approximation


95%CI ( 0.347- 0.529) Wilson's Approximation

. replace t=0
(163 real changes made)

. replace t=1 if P>=1 | HPV==1


(226 real changes made)

. diatest M t

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 115 63 | 178
1 | 23 163 | 186
-----------+----------------------+----------
Total | 138 226 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.876 0.829 0.924 0.820 0.920 0.821 0.916
SPEC 0.646 0.576 0.716 0.571 0.716 0.573 0.713
PPV 0.721 0.663 0.780 0.658 0.779 0.659 0.776
NPV 0.833 0.771 0.896 0.760 0.891 0.762 0.886
LR+ 2.476 2.016 3.041
LR- 0.191 0.129 0.285
----------------------------------------------------------------------

Youden index = 0.522 95%CI ( 0.438- 0.607) Normal Approximation


95%CI ( 0.436- 0.605) Wilson's Approximation

54
Tab.22 Estimated Sensitivity, Specificity, Likelihood ratios and Odds Ratio for repeated citology
(Pap), HPV and the combined P ∪ H test at each disease threshold.
Disease =LSIL or HSIL Disease = HSIL
SENS SPEC LR+ LR- OR SENS SPEC LR+ LR- OR
Pap# 0.780 0.736 2.952 0.300 9.840 0.875 0.570 2.037 0.219 9.301
HPV 0.661 0.775 2.943 0.437 6.735 0.750 0.637 2.068 0.392 5.276
P∪H 0.876 0.646 2.476 0.191 12.963 0.950 0.472 1.799 0.106 16.972
# Positive Pap Test = ASCUS, LSIL or HSIL

Likelihood ratios for the single test (Pap) and combined test.

55
Esempio 12
In Tab. 23 riportiamo i risultati di uno studio16 teso a stabilire se uno screening combinato di ispezione
visuale con acido acetico (VIA) e soluzione di Lugol (VILI) sia in grado di migliorare sia la diagnosi di
lesioni neoplastiche intraepiteliali cervicali (CIN 2-3), sia la diagnosi di cancro. Il test combinato è stato
messo a confronto con i test singoli: sia VIA, sia VILI e, tramite la stima dei falsi positivi addizioni si sono
stimati gli extra costi conseguenti all’eventuale introduzione nella pratica clinica del test combinato in
sostituzione dei test singoli.

Tab. 23 Cross-Classified VIA VILI results with category of disease outcomes (n = 54746)
D– D=CIN1 D=CIN 2-3 Cancer
Disease
VILI– VILI+ VILI– VILI+ VILI– VILI+ VILI– VILI+
VIA– 44106 1582 584 446 72 128 15 14
VIA+ 1723 3683 113 1284 15 707 2 272
VIA, visual inspection with acetic acid; VILI, visual inspection with Lugol’s iodine; CIN 1, cervical intraepithelial
neoplasia grade 1; CIN 2-3, cervical intraepithelial neoplasia grade 2-3; D–, disease absent

Sulla base di Tab.23 calcoleremo ora Sensibilità, 1-Specificità (FPR), Likelihood ratio e Odds Ratio
relativi a VIA, VILI e (VIA-VILI) combinati con outcome definito come CIN 2-3+.
Riorganizziamo i dati (D = CIN 2-3+):

Tab. 24 Cross-classified VIA VILI and Combined


Results with outcome = CIN 2-3+
VIA VILI Comb D W
1 1 1 0 4967
0 1 1 0 2028
1 0 1 0 1836
0 0 0 0 44690
1 1 1 1 979
0 1 1 1 142
1 0 1 1 17
0 0 0 1 87

. use "C:\Users\silva\Google Drive\Diagnostc Test\dataset_cin.dta", clear


. expand W

. diatest D VIA

| VIA
D | 0 1 | Total
-----------+----------------------+----------
0 | 46,718 6,803 | 53,521
1 | 229 996 | 1,225
-----------+----------------------+----------
Total | 46,947 7,799 | 54,746

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.813 0.791 0.835 0.790 0.835 0.790 0.834
SPEC 0.873 0.870 0.876 0.870 0.876 0.870 0.876
PPV 0.128 0.120 0.135 0.120 0.135 0.120 0.135
NPV 0.995 0.994 0.996 0.994 0.996 0.994 0.996
LR+ 6.397 6.178 6.623
LR- 0.214 0.191 0.241
----------------------------------------------------------------------

Youden index = 0.686 95%CI ( 0.664- 0.708) Normal Approximation


95%CI ( 0.663- 0.707) Wilson's Approximation

56
. diatest D VILI

| VILI
D | 0 1 | Total
-----------+----------------------+----------
0 | 46,526 6,995 | 53,521
1 | 104 1,121 | 1,225
-----------+----------------------+----------
Total | 46,630 8,116 | 54,746

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.915 0.899 0.931 0.898 0.930 0.898 0.929
SPEC 0.869 0.866 0.872 0.866 0.872 0.866 0.872
PPV 0.138 0.131 0.146 0.131 0.146 0.131 0.146
NPV 0.998 0.997 0.998 0.997 0.998 0.997 0.998
LR+ 7.002 6.810 7.199
LR- 0.098 0.081 0.117
----------------------------------------------------------------------

Youden index = 0.784 95%CI ( 0.769- 0.800) Normal Approximation


95%CI ( 0.767- 0.799) Wilson's Approximation

. diatest D Comb

| Comb
D | 0 1 | Total
-----------+----------------------+----------
0 | 44,690 8,831 | 53,521
1 | 87 1,138 | 1,225
-----------+----------------------+----------
Total | 44,777 9,969 | 54,746

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.929 0.915 0.943 0.913 0.943 0.913 0.942
SPEC 0.835 0.832 0.838 0.832 0.838 0.832 0.838
PPV 0.114 0.108 0.120 0.108 0.121 0.108 0.121
NPV 0.998 0.998 0.998 0.998 0.998 0.998 0.998
LR+ 5.630 5.494 5.770
LR- 0.085 0.069 0.104
----------------------------------------------------------------------

Youden index = 0.764 95%CI ( 0.749- 0.779) Normal Approximation


95%CI ( 0.748- 0.777) Wilson's Approximation

Tab 25 Estimated Sensibility (detection rate), false-positive rate, odds of being affected given a
positive result and likelihood ratios for VIA alone, VILI alone and combined VIA and VILI at
outcome CIN 2-3+
Test DR(95%CI)# FPR(95%CI)# OAPR LR+(95%CI)‡ LR–(95%CI)‡
VIA† 0.813(0.790;0.835) 0.127(0.124;0.130) 1/6.812 6.397(6.178;6.623) 0.214(0.191;0.241)
VILI¥ 0.915(0.898;0.930) 0.131(0.128;0.134) 1/6.246 7.002(6.810;7.199) 0.098(0.081;0.117)
Comb¶ 0.929(0.913;0.943) 0.165(0.162;0.168) 1/7.772 5.630(5.494;5.770) 0.085(0.069:0.104)
VIA, visual inspection with acetic acid; VILI, visual inspection with Lugol’s iodine;CIN 2-3+, cervical
intraepithelial neoplasia grade 2-3 and cancer; DR, detection rate (Sensitivity);
FPR, false positive rate (1-Specificity); OAPR, odds of being affected given a positive result; LR+, positive
likelihood ratio; LR–, negative likelihood ratio; CI, confidence interval
† VIA, VIA alone;
¥ VILI, VILI alone;
¶ Comb, combined VIA and VILI.
# Exact Confidence Intervals
‡ Wald Confidence Intervals

57
L’Odds di malattia, conseguente ad un test positive, si ottiene moltiplicando l’Odds a priori di malattia
per il corrispondente LR+

Ad esempio, con una prevalenza a pari a:

1125
P (D) = = 0.022376
54746

avremo

P (D)
Oddsa priori = = 0.022888
1− P (D)

E con riferimento al test VIA si avremo:

1
OAPR = 0.022888 ⋅ 6.397 = 0.146416 =
6.82986

In Tab. 26 riportiamo gli OAPR (odds of being affect given a positive result) in corrispondenza di
prefissate prevalenze:

Tab. 26 Odds of being affected given


positive result for outcome CIN 2.3+ by
varying disease prevalence
OAPR
Prev(%) VIA VILI Comb
0.6 1/25.9 1/23.7 1/29.4
0.7 1/22.2 1/20.3 1/25.2
0.8 1/19.4 1/17.7 1/22.0
0.9 1/17.2 1/15.7 1/19.6
1 1/15.6 1/14.1 1/17.6
2 1/7.66 1/7.00 1/8.70
3 1/5.05 1/4.62 1/5.74
4 1/3.75 1/3.43 1/4.27
5 1/2.97 1/2.71 1/3.37
6 1/2.45 1/2.24 1/2.78
7 1/2.08 1/1.90 1/2.36
8 1/1.80 1/1.64 1/2.04
VIA, visual inspection with acetic acid;
VILI, visual inspection with Lugol’s iodine;
CIN 2-3+, cervical intraepithelial neoplasia
grade 2-3 and cancer; OAPR, odds of being
affected given a positive result.

VIA vs Combined Test

Considerato VIA come test base i rapporti degli LR+ e degli LR– rispetto ai test combinati valgono:
+ −
LRCOMB 5.630 LRCOMB 0.085
LRR + = +
= = 0.88 LRR − = −
= = 0.397 (1.47)
LRVIA 6.397 LRVIA 0.214

Per valutare, tuttavia, la significatività dei rapporti calcolati dobbiamo determinare i rispettivi
intervalli di confidenza e controllare se tali intervalli comprendano o meno il valore 1.

58
Riorganizziamo i dati:

Probabilities of pairs of tests results for the single Test (VIA and the combined test
VIA ∪ VILI
Test A MALATI NON MALATI
+ VIA ∪ VILI – + VIA ∪ VILI –
+ π ++
+ +
= p++ +
+ p+− π +−
+
=0 π ++ = p++ + p+−
− − −
π +−

=0
– π −+
+ +
= p−+ π −−
+ +
= p−− π −+ = p−+
− −
π −− = p−−
− −

Occurrences of pairs of tests results for the single Test (VIA) and the combined test
VIA ∪ VILI
Test A MALATI (1225) NON MALATI(53521)
+ VIA ∪ VILI – + VIA ∪ VILI –
+ 996 0 6083 0
– 142 87 2028 44690

Probabilities of pairs of tests results for the single Test (VIA) and the combined test
VIA ∪ VILI
Test A MALATI (1225) NON MALATI(53521)
+ VIA ∪ VILI – + VIA ∪ VILI –
+ 0.813 0 0.127 0
– 0.116 0.071 0.038 0.844

Utilizzando le (1.32) e (1.33) possiamo calcolare gli intervalli di confidenza dei rapporti ottenuti in
precedenza (1.47).

  LR +    LRCOMB
+
 
CI ( LLR + ) = exp ln  COMB
+  ± 1.96 var  ln  +    = {0.859;0.902}
  LRVIA    LRVIA   

  LR −    LRCOMB

 
CI ( LLR − ) = exp  ln  COMB
−  ± 1.96 var  ln  −    = {0.336;0.468}
  LRVIA    LRVIA   

Nessuno degli intervalli di confidenza comprende il valore 1, pertanto possiamo concludere che entrambi
gli LR riferiti al Test VIA , sia positivi, sia negativi, sono diminuiti, in termini statisticamente
significativi, rispetto a quelli omologhi relativi al test combinato ( VIA ∪ VILI ).

I risultati sono purtroppo contradditori. Se da un lato la diminuzione dell’LR+ è a favore del test Singolo
(VIA), dall’altro la diminuzione dell’LR– indica una superiorità del test combinato.

Non potremo pertanto che scegliere una soluzione di compromesso valutando i TP e i FP addizionali. In
Tab.27 riportiamo i rapporti tra il numero di FP e TP addizionali, con definizione di malato definita da
CIN2-3+, in corrispondenza della prevalenza di malattia e con trade-off T = 0.

Riportiamo per esteso i calcoli condotti per il caso di una prevalenza di malattia θ del 2%. Faremo uso
delle (1.40) e (1.41).

59
(1 − θ ) π −+− (1 − 0.2 ) ⋅ 0.038
R* = = = 16.05 → 16
θπ +
−+ 0.02 ⋅ 0.116

1 − π −+
+
1−π − 1 − 0.116 1 − 0.038
se ln ( R* )  = + − −+ = + = 0.081817
π −+ nM π −+ nM
+
0.116 ⋅1225 0.038 ⋅ 53521

{ }
CI ( R * ) = exp ln ( R * ) ± 1.96 ⋅ se  ln ( R * )  = {13.67;18.84}

Tab. 27 Ratio (R*) of the number of


additional false positives per additional
true positive for outcome CIN 2-3+ at
varying disease prevalence, assuming a
zero trade-off. VIA with VILI as
additional test
Prev (%) R* CI95%(R*)
0.6 54.27 46.23 63.71
0.7 46.47 39.59 54.55
0.8 40.62 34.6 47.69
0.9 36.07 30.73 42.34
1 32.43 27.63 38.07
2 16.05 13.67 18.84
3 10.59 9.02 12.43
4 7.86 6.7 9.23
5 6.22 5.3 7.31
6 5.13 4.37 6.02
7 4.35 3.71 5.11
8 3.77 3.21 4.42

Sulla base dei dati di Tab. 27 si dovrebbe preferire l’uso del solo test VIA nel caso in cui il rapporto
R = FP / TP sia maggiore o uguale a 16.

Con R=16.05, applicando la (1.38) avremo, come conferma:

T = R* ⋅ θ ⋅ π −+
+
− (1 − θ ) ⋅ π −+

= 16.05 ⋅ 0.02 ⋅ 0.116 − 0.98 ⋅ 0.038 ≅ 0
R TP FP

D’altra parte, con i nostri dati, si ha:

VIA VIA ∪ VILI


0 1 0 1
0 46718 6803 53521 44690 8831 53521
M
1 229 996 1225 87 1138 1225
46947 7799 54746 44777 9969 54746

VIA VIA ∪VILI ∆


FP 6803 8831 2028 ∆FP / ∆TP 14.3
TP 996 1138 142
Dato che 14.3 < 16.05, dal punto di vista delle misclassificazioni, il test combinato risulta superiore.

60
PUNTO 2
MH
TP FP FN TN
TP 8 NA 1 NA
BMCA FP NA 79 NA 8
FN 4 NA 3 NA
TN NA 3 NA 2

Overall test of significance for both the sensitivities and specificities of the two procedures
Mc Nemar chi(2) = 4.0727273
Probability = .1305024

MH

TP FP FN TN
TP 9 NA 4 NA
HOII FP NA 116 NA 15
FN 9 NA 5 NA
TN NA 2 NA 3

Overall test of significance for both the sensitivities and specificities of the two procedures
Mc Nemar chi(2) = 11.864253
Probability = .00265283

PUNTO 3

Test Sensitivities Specificities


χ2
1
0.165 0.0016
MH vs HOII
Fisher’s Exact 0.267 0.0023

χ12 0.179 0.132


MH vs BMCA
Fisher’s Exact 0.375 0.226

Because the number of patients with differing test results is small (<20)
using the exact test will be better!!!

32
Esempio 13

Supponiamo di avere a disposizione, per la diagnosi di diabete, due test:


Test A (valutazione glicemia) con SENS = 0.7 e SPEC = 0.8
Test B (test di tolleranza al glucosio) con SENS = 0.90 e SPEC = 0.9.
Impostiamo uno screening sottoponendo la popolazione di 10000 soggetti al test A e successivamente
sottoponendo a Test B i soli soggetti risultati positivi al test B.
Considereremo positivi al test combinato, e pertanto assegneremo diagnosi di diabete, ai soggetti positivi
a entrambi i test.
Ipotizziamo questi risultati:

Test A Test B
D D D D
T+ 350 1900 2250 Intoll. T+ 315 190 505
Glicemia
T- 150 7600 7750 Glucosio T- 35 1710 1745
500 9500 10000 350 1900 2250

315 1710 + 7600


SENSC = = 0.63 SPECC = = 0.98
500 9500

Valori che sono in accordo con le (1.27), infatti:


SENSC = SENSA ⋅ SENSB = 0.7 ⋅ 0.9 = 0.63
SPECC = SPECA + SPECB − SPECA ⋅ SPECB = 0.8 + 0.9 − 0.72 = 0.98

Esempio 14

Con riferimento ai dati dell’esempio precedente impostiamo uno screening sottoponendo al Test B i
soggetti negativi al test A. Considereremo positivi i soggetti con un test positivo.

Test A Test B
D D D D
T+ 350 1900 2250 Intoll. T+ 135 760 895
Glicemia
T- 150 7600 7750 Glucosio T- 15 6840 6855
500 9500 10000 150 7600 7750

485 6840
SENSC = = 0.97 SPECC = = 0.72
500 9500

Valori che sono in accordo con le (1.28), infatti:


SENSC = SENSA + SENSB − SENSA ⋅ SENSB = 0.7 + 0.9 − 0.63 = 0.97
SPECC = SPECA ⋅ SPECB = 0.8 ⋅ 0.9 = 0.72

62
PUNTO 4

HOII vs MH

SENSHOII = 0.375 SENSMH = 0.583 ∆SENSHOIIvsMH = -0.208

CI95% ( ∆SENSHOIIvsMH )

Method LL UL
Wilson -.45069107 .07548941
Newcombe -.45069107 .07548941
Wald -.49074339 *** .07407672

SPECHOII = 0.868 SPECMH = 0.963 ∆SPECHOIIvsMH = -0.095

CI95% ( ∆SPECHOIIvsMH )
Method LL UL
Wilson -.1603308 *** -.03915582
Newcombe -.16157256 *** -.03697116
Wald -.1527965 *** -.03837997

BMCA vs MH

SENSBMCA = 0.25 SENSMH = 0.4375 ∆SENSHOIIvsMH = -0.1875

CI95% ( ∆SENSBMCAvsMH )
Method LL UL
Wilson -.41182184 *** .06914427
Newcombe -.43299448 *** .09637842
Wald -.44555084 *** .07055084

SPECBMCA = 0.8913 SPECMH = 0.9457 ∆SPECHOIIvsMH = -0.0544

CI95% ( ∆SPECBMCAvsMH )

Method LL UL
Wilson -.13332696 *** .01878051
Newcombe -.1357013 *** .0221138
Wald -.12412814 *** .01543249

33
Fig. 6 The effect of applying different criteria for a positive combination on predictive value positive and
predictive value negative.

64
Esempio 15

Una giovane signora, la cui sorella maggiore ha una SLE (Systemic Lupus Erythematosus) documentata
da 6 mesi, si presenta dal dott, Smith con una anamnesi di diffuse artralgie e la comparsa di un recente
rash maculare sulle guance.18
Un reumatologo, a cui è stata richiesta una consulenza, ha stimato una probabilità di SLE del 10% e ha
consigliato una biopsia cutanea e un test per la ricerca di anticorpo antinucleo (FANA)18.
Le caratteristiche individuali di questi test sono ben note:
Biopsia SENS = 0.51 SPEC = 0.99
FANA SENS = 0.99 SPEC = 0.67

Il dott, Smith, prima di iniziare la terapia corticosteroidea, vuole avere la probabilità di presenza di SLE
di almeno il 90% ; per contro, prima tranquillizzare la paziente ed escludere la SLE vuole che la
probabilità di esclusione sia almeno del 98%.

Si possono configurare diversi scenari coerenti con i dati del problema:


• Parallel Testing (AND)

Applicando il criterio AND si ha:

SENSC = 505 / 1000 = 50.5% SPECC = ( 60 + 2940 + 5970 ) / 9000 = 99.67%


P (TC + ) = 535 / 10000 = 5.35% P ( D | TC + ) = 505 / 535 = 94.4%
P (TC − ) = ( 65 + 3425 + 5975 ) / 10000 = 94.6% P ( D | TC − ) = ( 5 + 485 + 5 ) / 9465 = 5.3%
TP + TN 505 + 60 + 2940 + 5970
Efficiency = = = 47.4%
nTest
. 2 ⋅10000

Se la paziente viene sottoposta ai test in parallelo con criterio AND, il dott. Smith può prendere queste
decisioni:
1. Test Positivo: inizio terapia corticosteroidea
2. Test Negativo: non ha elementi sufficienti per rassicurare la paziente circa l’assenza di SLE

• Parallel Testing (OR)

SENSC = ( 505 + 5 + 485 ) / 1000 = 99.5% SPECC = 5970 / 9000 = 66.3%


P (TC + ) = ( 535 + 65 + 3425 ) / 10000 = 40.25% P ( D | TC + ) = ( 505 + 5 + 485 ) / ( 535 + 65 + 3425 ) = 24.7%
P (TC − ) = 5975 /10000 = 59.75% P ( D | TC − ) = 5 / 5975 < 0.1%
TP + TN 505 + 5 + 485 + 5970
Efficiency = = = 34.8%
nTest
. 2 ⋅10000

65
Se la paziente viene sottoposta ai test in parallelo con criterio OR, il dott. Smith può prendere queste
decisioni:
1. Test Positivo: terapia corticosteroidea non sufficientemente supportata
2. Test Negativo: ha elementi sufficienti per rassicurare la paziente circa l’assenza di SLE

• Serial Tests (FANA first)

P (T1 + ) = 3960 / 10000 = 39.6% P ( D | T1 + ) = 990 / 3960 = 25%


P (T1 − ) = 6040 / 10000 = 60.4% P ( D | T1 − ) = 10 / 6040 = 0.16%

Già dopo il primo test (FANA) il dott. Smith può prendere delle decisioni:

1. Test FANA positivo: le evidenze non sono sufficiente per fare diagnosi di SLE. Occorre
sottoporre la paziente a biopsia cutanea
2. Test FANA negativo: ha elementi sufficienti per rassicurare la paziente circa l’assenza di SLE

Coerentemente con quanto affermato al punto 1, i soli soggetti positivi al test FANA (3960) saranno
sopposti a biopsia cutanea. I risultati attesi sono presentati in Tab.3.

P (T2 + ) = 535 / 3960 = 13.5% P ( D | T2 + ) = 505 / 535 = 94.4%

Sulla base dell’esito della biopsia il dott. Smith prenderà le seguenti decisioni:

1. Biopsia positiva: inizio terapia steroidea


2. Biopsia negativa: la paziente è già stata rassicurata in precedenza

Efficiency = ( 6030 + 2940 + 505 ) / (10000 + 3960 ) = 67.9%

L’efficienza dell’approccio seriale (FANA first, criterio AND)) è del 67.9% che deve essere confrontato
con il 47.4% di efficienza nell’approccio parallelo con criterio AND.
Nell’approccio seriale (FANA first, criterio AND) si risparmiano 6040 biopsie rispetto all’approccio
parallelo con criterio AND.

66
• Serial Tests (Biopsy first)

La Tab.4 riassume i risultati attesi della biopsia qualora, nel caso di un approccio seriale, sia il primo test
a cui sottoporre i pazienti.

P (T1 + ) = 600 / 10000 = 6% P ( D | T1 + ) = 510 / 600 = 85%


P (T1 − ) = 9400 / 10000 = 94% P ( D | T1 − ) = 490 / 9400 = 5.2%

Sulla base dell’esito della biopsia il dott. Smith prenderà le seguenti decisioni:

1. Biopsia positiva: non ci sono elementi sufficienti per iniziare la terapia steroidea
2. Biopsia negativa: non ha elementi sufficienti per rassicurare la paziente circa l’assenza di SLE

Quindi, in un approccio seriale (Biopsy first) il dott, Smith si trova nella necessità di richiedere il test
FANA indipendentemente dal risultato della biopsia
L’approccio quindi assume la forma parallela (tutti i soggetti sottoposti ad entrambi i test) anziché
seriale come ipotizzato in partenza.
I risultati potranno, anche in questo caso, essere interpretati assumendo i valori attesi di Tab.1 con
criterio AND o con criterio OR.

Discussione

Approccio Criterio Efficienza


1 Parallelo AND 47.4%
2 Parallelo OR 34.8%
3 Seriale (FANA first) AND 67.9%
4 Seriale (Biopsy first) AND 47.4%
5 Seriale (Biopsy first) OR 34.8%

Gli approcci 4-5 non mostrano alcun vantaggio rispetto agli approcci 1-2, per contro ritardano i tempi
della diagnosi.

In questo contesto l’approccio 3 pare superiore.

67
Test Multipli Correlati
Nella precedente sezione abbiamo considerato test fra loro non correlati. Indicati con T1 e T2 i due test e
con D e D la condizione rispettivamente di malato e sano, abbiamo sempre ritenuto i due test
statisticamente indipendenti, ossia che fossero valide le (1.48) e (1.49):

P (T2 + | D ) = P (T2 + | T1 +, D ) = P (T2 + | T1 −, D )


(1.48)
P (T2 − | D ) = P (T2 − | T1 +, D ) = P (T2 − | T1 −, D )

P (T2 + | D ) = P (T2 + | T1 +, D ) = P (T2 + | T1 −, D )


(1.49)
P (T2 − | D ) = P (T2 − | T1 +, D ) = P (T2 − | T1 −, D )

Quando due test non sono statisticamente indipendenti, sono detti statisticamente dipendenti o correlati.

Quando due test non sono indipendenti, per la determinazione della sensibilità e della specificità combinata
non potremo far uso delle (1.27) e (1.28) ma dovremo procedere per altra via19.

In Tab.16 riportiamo gli ipotetici risultati di due test T1 e T2 applicati entrambi alla stessa popolazione di
malati e sani.

Tab.16 Cross-Tabulation of Screening Results by T1 and T2 #


D D
T1+ T1- T1+ T1-
T2+ a b β T2+ a’ b’ 1− γ
T2- c d 1− β T2- c’ d’ γ
α 1−α 1−φ φ
# i valori entro tabella non sono frequenze, bensì percentuali
Con α e β si sono indicate le sensibilità rispettivamente di T1 e T2, mentre con γ e φ le rispettive
specificità.

Con riferimento al criterio OR la sensibilità e la specificità del test combinato valgono:

SENSC = 1 − d = a + b + c SPECC = d ' (1.50)

Mentre con riferimento al criterio AND, la sensibilità e la specificità del test combinato valgono:

SENSC = a SPECC = 1 − a ' = b '+ c '+ d ' (1.51)

La distribuzione congiunta di coppie di dati binari coerenti con le due probabilità marginali p1 e p2, tenuto
conto del coefficiente di correlazione ρ tra X e Y, può essere caratterizzata nel seguente modo20:

Cross-Classification Probabilities
X=1 X=0
Y=1 π 11 π 01 p1
Y=0 π 10 π 00 q1
p2 q2
π 11 = p1 p2 + τ π 10 = p2 q1 − τ
π 01 = p1q2 − τ π 00 = q1q2 + τ (1.52)
τ = ρ p1q1 p2 q2

68
La K di Cohen, riferita alla distribuzione congiunta prima considerata vale:

I 0 − Ie
k= (1.53)
1 − Ie

dove:

I0 = π 11 + π 00 = p1 p2 + q1q2 + 2τ è la proporzione di accordo osservata

Ie = p1 p2 + q1q21 è la proporzione di accordo attesa per il solo effetto del caso.

Sostituendo le espressioni di I0 e Ie nella (1.53) si ha:

2 ρ ( p1q1 p2 q2 )
1/ 2

k= (1.54)
( p1q2 + p2 q1 )
da cui anche:

τ = k ( p1q2 + p2 q2 ) / 2 (1.55)

Per testare l’ipotesi che i due test siano non correlati si può utilizzare la varianza stimata di k di seguito
riportata:

(
σ 02 = var kˆ | k = 0 = ) 4 pˆ1 pˆ 2 qˆ1qˆ2
n ( pˆ1qˆ1 + pˆ 2 qˆ2 )
2
(1.56)

E la presenza di una correlazione può essere verificata con uno z-test


z0 = (1.57)
σ0

Tenuto conto delle (1.52) e delle (1.50) e (1.51) si ha:

d = (1 − α )(1 − β ) + τ + d ' = γφ + τ −
(1.58)
a = αβ + τ + a ' = (1 − γ )(1 − φ ) + τ −

dove:

τ + = ρ + αβ (1 − α )(1 − β ) τ − = ρ − γφ (1 − γ )(1 − φ )

a − αβ d '− γφ
ρ+ = ρ− = (1.59)
αβ (1 − α )(1 − β ) γφ (1 − γ )(1 − φ )

e dove con ρ+ e ρ − si sono indicate le correlazioni tra i test nei gruppi rispettivamente dei malati e dei
sani.

Per illustrare gli effetti della correlazione tra i test, considereremo, con criterio AND, due test entrambi
con sensibilità e specificità paria 0.95 e correlati con ρ = 0.5 sia nella popolazione dei malati, sia nella
popolazione dei sani.

69
Dalla Fig.7, vediamo come, tenendo conto della correlazione, gli effetti sul PPV e sul NPV dell’aggiunta
di un secondo test tende ad attenuarsi.

Fig. 7 The effect of test correlation on Predictive Value


Positive (A) and Predictive Value Negative (B) using the both
tests abnormal positivity criterion

Single Test

SENSS = 0.95 SPECS = 0.95

Two Statistically Independent Tests

SENSCU = 0.95 ⋅ 0.95 = 0.9025 SPECCU =0.95 + 0.95 − 0.95 ⋅ 0.95 = 0.9975

Two Correlated Tests [see (1.58)]


ρ + =ρ − =0.5 τ + = τ − = 0.02375
a = 0.95 ⋅ 0.95 + 0.02375 = 0.92625 a ' = 0.05 ⋅ 0.05 + 0.02375 = 0.02625
SENSCC = a = 0.92625 SPECCC = 1 − a ' = 0.97375

70
Esercizio 16
Due test, A e B, con sensibilità e specificità note vengono somministrati in contemporanea a una
popolazione coerente con quella da cui sono state ottenute le caratteristiche individuali dei test e
costituita da 5000 soggetti.

Con riferimento alle cross-tabulation sotto riportate si richiede di:

1. determinare se le correlazioni tra i test (nelle popolazioni di sani e malati) sono statisticamente
significative:
2. indipendentemente dal risultato del test di cui al punto precedente, determinare la correlazione
tra i test nella popolazione dei malati
3. determinare il PPV,in corrispondenza di una prevalenza di malattia del 10%, sia nell’ipotesi di
test scorrelati, sia nell’ipotesi di test correlati. (criterio AND)

 A = 0.8  A = 0.75
SENS  SPEC 
B = 0.75 B = 0.8

Malati Non malati


Test B Test B
+ – + –
+ 0.7 0.10 0.8 0.15 0.1 0.25
Test A
– 0.05 0.15 0.2 0.05 0.7 0.75
0.75 0.25 0.2 0.8

Malati Non malati


(500) (4500)
Test B Test B
+ – + –
+ 350 50 675 450
Test A
– 25 75 225 3150

• Punto 1
Ie = 0.8 ⋅ 0.75 + 0.25 ⋅ 0.2 = 0.65
Io = 0.7 + 0.15 = 0.85
Io − Ie 0.85 − 0.65
k= = = 0.571
1 − Ie 1 − 0.65

( )
σ 02 = var kˆ | k = 0 =
4 pˆ 1 pˆ 2 qˆ1qˆ2
n ( pˆ 1qˆ1 + pˆ 2 qˆ2 )
2
= 0.001987 →
k
σ0
= 12.08  p < 0.05

La correlazione tra i test, nella popolazione dei malati, è significativamente diversa da zero.

71
• Punto 2

a − αβ 0.7 − 0.8 ⋅ 0.75


ρ+ = = = 0.577
αβ (1 − α )(1 − β ) 0.8 ⋅ 0.75 ( 0.2 )( 0.25 )

• Punto 3

SENSCU = 0.8 ⋅ 0.75 = 0.6 SPECCU = 0.8 + 0.75 − 0.8 ⋅ 0.75 = 0.95

SENSCU ⋅ P ( M )
P ( M | T + )CU = = 0.571
SENSCU ⋅ P ( M ) + [1 − SPECCU ] ⋅ P ( M )

SENSCC = a = 0.7 SPECCC = 1 − a ' = 0.85

SENSCC ⋅ P ( M )
P ( M | T + )CC = = 0.341
SENSCC ⋅ P ( M ) + [1 − SPECCC ] ⋅ P ( M )

72
Modellazione logistica delle caratteristiche di un test diagnostico dicotomico
Con riferimento alla cross-tabulation sotto riportata determineremo direttamente SENS, SPEC. PPV e
NPV e poi ricaveremo le stesse proprietà tramite un modello logistico adeguato.21

Cross-Tabulation
D=0 D=1
T=0 1730 68 1798
T=1 1119 422 1541
2849 490 3339

422 1730
SENS = = 0.861 SPEC = = 0.607
490 2849
422 1730
PPV = = 0.274 NPV = = 0.962
1541 1798

Implementiamo un modello logistico con T come variabile dipendente e D come indipendente:


. logit T D

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
D | 2.261184 .1361883 16.60 0.000 1.99426 2.528108
_cons | -.435686 .0383626 -11.36 0.000 -.5108753 -.3604966
------------------------------------------------------------------------------
Dalla definizione di logit otteniamo:

 π ( y) 
log  = β 0 + β1D = −0.435686 + 2.261184 ⋅ D
 1 − π ( y ) 
 
 π ( y) 
log   = β 0 + β1D = −0.435686 + 2.261184 ⋅1
 1 − π ( y )  D =1
exp ( β 0 + β1 ) exp ( −0.435686 + 2.261184 )
π ( y )D =1 = SENS = = = 0.861
1 + exp ( β 0 + β1 ) 1 + exp ( −0.435686 + 2.261184 )
 π ( y) 
log   = β 0 + β1D = −0.435686
 1 − π ( y ) D =0
exp ( β 0 ) 1
π ( y )D = 0 = → 1 − π ( x )D = 0 = SPEC = = 0.607
1 + exp ( β 0 ) 1 + ex p ( β 0 )

La varianza di SENS e SPEC si ottengono facilmente dalla matrice di varianza-covarianza associata al


modello logistico.

var ( β 0 + β1 ) = var ( β 0 ) + var ( β1 ) + 2 cov ( β0 , β1 )


. mat A=e(V)
. mat list A

symmetric A[2,2]
T: T:
D _cons
T:D .01854724
T:_cons -.00147169 .00147169

. local var=A[1,1]+A[2,2]+2*A[2,1]

73
. mat B=e(b)
. mat list B

B[1,2]
T: T:
D _cons
y1 2.2611836 -.43568598

local lls= exp(B[1,1]+B[1,2]+1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]+1.96*sqrt(`var')))


. display `lls'
.88910362

local lli=
exp(B[1,1]+B[1,2]-1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]-1.96*sqrt(`var')))
. display `lli'
.82769487

Adesso implementiamo un modello per derivare PPV e NPV

In questo caso dovremo utilizzare un modello logistico con D come variabile dipendente e il risultato del
Test T come dipendente.
. logit D T

------------------------------------------------------------------------------
D | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
T | 2.261184 .1361883 16.60 0.000 1.99426 2.528108
_cons | -3.236369 .1236282 -26.18 0.000 -3.478676 -2.994063
------------------------------------------------------------------------------

exp ( −3.236369 + 2.261184 )


PPV = = 0.274
1 + exp ( −3.236369 + 2.261184 )

1
PPV = = 0.962
1 + exp ( −3.236369 )

Esempio 17
La tabella sotto rappresentata riporta la performance di un test diagnostico EZ-Detect (EZ)a utilizzato
per la determinazione di presenza di neoplasia colorettale.22

Polyps
Target SENS CI(95%)‡ SPEC CI(95%)‡
Yes NO
All T+ 9 15
0.143 0.056 0.229 0.895 0.845 0.945
Adenomas T- 54 128

Advanced T+ 1 23
0.143 0 0.402 0.885 0.841 0.929
Adenomas T- 6 177
‡ Intervallo di confidenza binomiale (Wald)

Dedurremo SENS e SPEC, con relativi intervalli di confidenza, tramite l’utilizzo di un modello logistico.

a
un tipo di FOBT (Fecal Occult Blood Test)
74
ALL ADENOMAS
. use "C:\Users\silva\Google Drive\Diagnostc Test\logistic_sens_spec2.dta", clear
. expand W
. logit T M

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
M | .3522206 .451784 0.78 0.436 -.5332598 1.237701
_cons | -2.14398 .2729087 -7.86 0.000 -2.678871 -1.609089
------------------------------------------------------------------------------

. mat A=e(V)
. mat list A

symmetric A[2,2]
T: T:
M _cons
T:M .2041088
T:_cons -.07447917 .07447917

. mat B=e(b)
. local var=A[1,1]+A[2,2]+2*A[2,1]

. local lls= exp(B[1,1]+B[1,2]+1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]+1.96*sqrt(`var')))


. local lli=exp(B[1,1]+B[1,2]-1.96*sqrt(`var'))/ (1+exp(B[1,1]+B[1,2]-1.96*sqrt(`var')))
. local SENS=exp(B[1,1]+B[1,2])/(1+exp(B[1,1]+B[1,2]))
. display `SENS'
.14285714
. display `lls'
.25235738
. display `lli'
.07603783
*
. local var=A[2,2]
. local lls= 1/(1+exp(B[1,2]-1.96*sqrt(`var')))
. local lli= 1/(1+exp(B[1,2]+1.96*sqrt(`var')))
. local SPEC=1/(1+exp(B[1,2]))
. display `SPEC'
.8951049
. display `lls'
.93576891
. display `lli'
.83328348

ADVANCED ADENOMAS
. use "C:\Users\silva\Google Drive\Diagnostc Test\logistic_sens_spec3.dta", clear
. expand W
(203 observations created)

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
M | .2488961 1.102631 0.23 0.821 -1.912221 2.410013
_cons | -2.040656 .2216483 -9.21 0.000 -2.475078 -1.606233
------------------------------------------------------------------------------

. mat A=e(V)
. mat list A

symmetric A[2,2]
T: T:
M _cons
T:M 1.2157946
T:_cons -.04912798 .04912798

. mat B=e(b)

. local var=A[1,1]+A[2,2]+2*A[2,1]
. local lls= exp(B[1,1]+B[1,2]+1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]+1.96*sqrt(`var')))
. local lli=exp(B[1,1]+B[1,2]-1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]-1.96*sqrt(`var')))
. local SENS=exp(B[1,1]+B[1,2])/(1+exp(B[1,1]+B[1,2]))
. display `SENS'
.14285714
. display `lls'
.58061109
75
Interpretazione OR

La SENS del test combinato sarà sempre superiore alla sensibilità del singolo test
La SPEC del test combinato sarà sempre inferiore alla specificità del test singolo

Considerato un Test A, l’aggiunta seriale di un test B (con interpretazione OR) il punto di lavoro, nel
piano ROC, del test combinato C si può collocare esclusivamente all’interno del rettangolo ACEF.
All’interno di tale rettangolo si riconoscono tre aree.

Area ACD: all’interno di questa area il test combinato è senz’altro superiore al test singolo dato che
LR +C > LR + SINGLE LR −C < LR −SINGLE

Area AEF: all’interno di quest’area il test combinato è senz’altro inferiore al test singolo dato che
LR +C + < LR +SINGLE LR −C > LR −SINGLE

Area ADE: all’interno di tale area non è possibile, sulla base dei soli LR, effettuare una chiara scelta tra
test singolo e test combinato.

E’ Utile l’Aggiunta di un secondo Test?


Per cercare di dare una risposta alla domanda dobbiamo preliminarmente ricavare le caratteristiche di
un singolo test facente parte di una coppia di test sottoposti ai medesimi soggetti.

Caratteristiche del Test Singolo


Consideriamo, al solito, due test A e B entrambi sottoposti a un campione di N individui di cui M malati
e NM non malati. Di seguito riportiamo le frequenza assolute, e le percentuali, dei risultati dei test:

Tab.17 NON MALATI (NM) MALATI (M)


(50900) (915)
B+ B- B+ B-
A+ 3500 1800 700 15
A- 1600 44000 130 70

41
Popolazione SENS# CI(95%)‡ SPEC# CI(95%)‡
Generale 0.833 0.720 0.903 0.714 0.660 0.763
Alto Rischio 0.926 0.872 0.972 0.415 0.291 0.551
Basso Rischio 0.556 0.330 0.760 0.780 0.723 0.828
‡ Intervallo di confidenza ottenuto dalla martice di covarianza del modello logistico.
# Valori ricavati dal modello logistico

Popolazione generale

T=1 test positivo T=0 test negative P=1 Malato P=0 Non Malato
. xi:logit T i.P
------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_IP_1 | 2.525729 .341565 7.39 0.000 1.856273 3.195184
_cons | -.9162907 .1290994 -7.10 0.000 -1.169321 -.6632605
------------------------------------------------------------------------------

. mat A=e(V)
. mat B=e(b)
. local var=A[1,1]+A[2,2]+2*A[2,1]

. local lls= exp(B[1,1]+B[1,2]+1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]+1.96*sqrt(`var')))


. local lli=exp(B[1,1]+B[1,2]-1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2]-1.96*sqrt(`var')))
. local SENS=exp(B[1,1]+B[1,2])/(1+exp(B[1,1]+B[1,2]))
. display `SENS'
.83333333
. display `lls'
.90284509
. display `lli'
.72901512
. *
. local var=A[2,2]
. local lls= 1/(1+exp(B[1,2]+1.96*sqrt(`var')))
. local lli= 1/(1+exp(B[1,2]-1.96*sqrt(`var')))
. local SPEC=1/(1+exp(B[1,2]))
. display `SPEC'
.71428571
. display `lls'
.7630231
. display `lli'
.65999138
Coefficient Matrix
β1 β2
y
2.5257286 -0.91629073

Covariance Matrix
β1 β2
β1 0.11666666
β2 -0.01666667 .01666667

var ( β1 ) = 0.11666666 var ( β 2 ) = .01666667 cov ( β1 , β 2 ) = −0.01666667


SENS = exp ( β1 + β 2 ) / 1 + exp ( β1 + β 2 ) 
SPEC = 1/ 1 + exp ( β 2 ) 
var ( SENS ) = var ( β1 ) + var ( β2 ) + 2cov ( β1 , β 2 )
var ( SPEC ) = v ar ( β1 ) + var ( β 2 ) + 2cov ( β1 , β2 ) = var ( β 2 )

77
Popolazione generale stratificata

T=1 Test Positivo T=0 Test Negativo P=1 Malato P=0 Non malato
HR=1 Alto Rischio HR=0 Basso Rischio INT=P*HR

Coefficient Matrix
P HR INT CONS
β1 β2 β3 β4
1.4892936 1.6090948 0.69349026 -1.26615

Covariance Matrix
β1 β2 β3 β4
β1 0.24918707
β2 0.02418707 0.10189968
β3 -0.24918707 -0.10189968 0.59689968
β4 -0.02418707 -0.02418707 0.02418707 0.02418707

Popolazione ad Alto Rischio

HR=1
. xi: logit T i.P*i.HR

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_IP_1 | 1.489294 .4991864 2.98 0.003 .5109062 2.467681
_IHR_1 | 1.609095 .3192173 5.04 0.000 .9834404 2.234749
_IPXHR_1_1 | .6934903 .7725928 0.90 0.369 -.8207639 2.207744
_cons | -1.26615 .1555219 -8.14 0.000 -1.570967 -.9613327
------------------------------------------------------------------------------

. mat A=e(V)
. mat B=e(b)
. *SENS HR=1 INT=1
. local var=A[1,1]+A[2,2]+A[3,3]+A[4,4]
. local cov=2*(A[2,1]+A[3,1]+A[4,1]+A[3,2]+A[4,2]+A[4,3])
. local var=`var'+`cov'
. local lls= exp(B[1,1]+B[1,2]+B[1,3]+B[1,4]+1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2] ///
+B[1,3]+B[1,4]+1.96*sqrt(`var')))
. local lli= exp(B[1,1]+B[1,2]+B[1,3]+B[1,4]-1.96*sqrt(`var'))/(1+exp(B[1,1]+B[1,2] ///
+B[1,3]+B[1,4]-1.96*sqrt(`var')))
. local SENS=exp(B[1,1]+B[1,2]+B[1,3]+B[1,4])/(1+exp(B[1,1]+B[1,2]+B[1,3]+B[1,4]))
. display `SENS'
.92592592
. display `lls'
.97191887
. display `lli'
.81865816
. *SPEC HR=1 INT=0-1=0
. local var=A[2,2]+A[4,4]
. local cov=2*(A[4,2])
. local var=`var'+`cov'
. local lli= 1/(1+exp(B[1,2]+B[1,4]+1.96*sqrt(`var')))
. local lls= 1/(1+exp(B[1,2]+B[1,4]-1.96*sqrt(`var')))
. local SPEC=1/(1+exp(B[1,2]+B[1,4]))
. display `SPEC'
.41509434
. display `lls'
.55068632
. display `lli'

78
.29124737

SENS = exp ( β1 + β 2 + β 3 + β 4 ) / 1 + exp ( β1 + β 2 + β 3 + β 4 ) 


SPEC = 1 / 1 + exp ( β 2 + β 4 ) 

var ( SENS ) = var ( β1 ) + var ( β 2 ) + var ( β 3 ) + var ( β 4 ) + 2  cov ( β 2 , β1 ) + cov ( β 3 , β1 ) + cov ( β 4 , β1 )


+ cov ( β 3 , β 2 ) + cov ( β 4 , β 2 ) + cov ( β 4 , β 3 ) 
var ( SPEC ) = var ( β 2 ) + var ( β 4 ) + 2  cov ( β 4 , β 2 ) 

Popolazione a Basso Rischio

HR=0

. *SENS HR=0 INT=0


. local var=A[1,1]+A[4,4]
. local cov=2*(A[4,1])
. local var=`var'+`cov'
. local lls= exp(B[1,1]+B[1,4]+1.96*sqrt(`var'))/(1+exp(B[1,1] ///
+B[1,4]+1.96*sqrt(`var')))
. local lli= exp(B[1,1]+B[1,4]-1.96*sqrt(`var'))/(1+exp(B[1,1] ///
+B[1,4]-1.96*sqrt(`var')))
. local SENS=exp(B[1,1]+B[1,4])/(1+exp(B[1,1]+B[1,4]))
. display `SENS'
.55555556
. display `lls'
.76003168
. display `lli'
.33035805
. *
. *SPEC HR=0 INT=0-1=0
. local var=A[4,4]
. local cov=2*(A[4,2])
. local var=`var'
. local lli= 1/(1+exp(B[1,4]+1.96*sqrt(`var')))
. local lls= 1/(1+exp(B[1,4]-1.96*sqrt(`var')))
. local SPEC=1/(1+exp(B[1,4]))
. display `SPEC'
.78008299
. display `lls'
.82792228
. display `lli'
.72338742

SENS = exp ( β1 + β 4 ) / 1 + exp ( β13 + β 4 ) 


SPEC = 1 / 1 + exp ( β 4 ) 

var ( SENS ) = var ( β 4 )


var ( SPEC ) = var ( β 2 ) + var ( β 4 ) + 2 cov ( β 4 , β 2 ) 

79
Confronto tra Sensibilità e Specificità tramite il modello Logistico

Con la modellazione logistica risulta abbastanza agevole anche il confronto tra sensibilità e specificità
relative ai diversi strati. Riprendiamo le formule utilizzate per ottenere sensibilità e specificità nei diversi
contesti: Popolazione generale, ad Alto Rischio, a Basso Rischio:

T (risultato del Test) 0 negativo 1 positivo


P (condizione) 0 Non Malato 1 Malato
HR (rischio) 0 A basso Rischio 1 Ad Alto Rischio
Int (interazione) P+HR 0 assente 1 presente

Popolazione Target SENS SPEC


exp ( β 1 + β 2 ) 1
Generale‡
1 + exp ( β 1 + β 2 ) 1 + exp ( β 2 )
exp ( β1 + β 2 + β 3 + β 4 ) 1
Ad Alto Rischio#
1 + exp ( β1 + β 2 + β 3 + β 4 ) 1 + exp ( β 2 + β 4 )
exp ( β 1 + β 4 ) 1
A Basso rischio#
1 + exp ( β 1 + β 4 ) 1 + exp ( β 4 )

‡ Model (1) xi: logit T i.P y = β1 ⋅ P + β2


# Model (2) xi: logit T i.P*i.HR y = β1 ⋅ P + β2HT + β3Int + β4

La valutazione delle differenze tra Sensibilità e Specificità nei due gruppi di rischio si effettua testando le
seguenti ipotesi nulle:

SENS H0 : ( β 2 ∧ β3 ) = 0 SPEC H0 : β2 = 0

SENS
. use "C:\Users\silva\Google Drive\Diagnostc Test\logistic_sens_spec1.dta", clear
. expand W
(358 observations created)

. xi: logit T i.P*i.HR

------------------------------------------------------------------------------
T | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_IP_1 | 1.489294 .4991864 2.98 0.003 .5109062 2.467681
_IHR_1 | 1.609095 .3192173 5.04 0.000 .9834404 2.234749
_IPXHR_1_1 | .6934903 .7725928 0.90 0.369 -.8207639 2.207744
_cons | -1.26615 .1555219 -8.14 0.000 -1.570967 -.9613327
------------------------------------------------------------------------------

. mat B=e(b)
. mat list B

B[1,4]
T: T: T: T:
_IP_1 _IHR_1 _IPXHR_1_1 _cons
y1 1.4892936 1.6090948 .69349026 -1.26615

SENS SPEC
. test _IHR_1 _IPXHR_1_1 . test _IHR_1

( 1) [T]_IHR_1 = 0 ( 1) [T]_IHR_1 = 0
( 2) [T]_IPXHR_1_1 = 0
chi2( 1) = 25.41
chi2( 2) = 36.12 Prob > chi2 = 0.0000
Prob > chi2 = 0.0000

80
Bootstrapping e calcolo di Sensibilità, Specificità e relativi intervalli di confidenza

File ado di “appoggio”


program ci_sens1, rclass
xi: logit T i.P
mat VC=e(V)
mat B=e(b)
local sens_t=exp(B[1,1]+B[1,2])/(1+exp(B[1,1]+B[1,2]))
local spec_t=exp(B[1,2])/(1+exp(B[1,2]))
return scalar sens_t=`sens_t'
return scalar spec_t=`spec_t'
*
xi: logit T i.P*i.HR
mat VC=e(V)
mat B=e(b)
local sens1 = exp(B[1,1]+B[1,2]+B[1,3]+B[1,4])/(1+exp(B[1,1]+B[1,2]+B[1,3]+B[1,4]))
local sens0=exp(B[1,1]+B[1,4])/(1+exp(B[1,1]+B[1,4]))
local spec1=1/(1+exp(B[1,1]+B[1,4]))
local spec0=1/(1+exp(B[1,4]))
scalar dsens =`sens1'-`sens0'
scalar dspec=`spec1'-`spec0'
return scalar dsens=dsens
return scalar dspec=dspec
return scalar sens1=`sens1'
return scalar sens0=`sens0'
return scalar spec1=`spec1'
return scalar spec0=`spec0'

end

Comando per effettuare il bootstrapping


. bs "ci_sens1" r(dsens) r(dspec) r(sens_t) r(spec_t) r(sens1) r(spec1) r(sens0) r(spec0),
reps(1000) saving (sara) replace trace

Variable Reps Observed Bias Std. Err. [95% Conf. Interval]

dsens‡ 1000 .3703704 -.0076243 .124341 .1263708 .61437 (N)


.1239779 .613078 (P)
.1480226 .6330514 (BC)
dspec# 1000 -.3649887 -.0021622 .0748369 -.5118441 -.2181332 (N)
-.5137601 -.2241526 (P)
-.5113095 -.2211215 (BC)
Sens_t 1000 .8333333 9.29e-06 .0439289 .7471298 .9195369 (N)
.7402334 .9125 (P)
.741573 .9130435 (BC)
Spec_t 1000 .7142857 .000264 .0263896 .6625004 .7660711 (N)
.6632244 .7652201 (P)
.6645367 .7665505 (BC)
Sens_hr 1000 .9259259 -.003271 .0372344 .8528592 .9989926 (N)
.8437909 .9813068 (P)
.8392857 .9811321 (BC)
Spec_hr 1000 .4150943 -.0015803 .0696208 .2784746 .5517141 (N)
.2808392 .5490196 (P)
.2857143 .5531915 (BC)
Sens_lr 1000 .5555556 .0043533 .1190664 .3219067 .7892045 (N)
.3333333 .7801932 (P)
.3125 .7692308 (BC)
Spec_lr 1000 .780083 .0005819 .0262813 .7285101 .8316559 (N)
.7287809 .8309661 (P)
.7272727 .8296943 (BC)

Note: N = normal
P = percentile
BC = bias-corrected

‡ dsens = Sens_hr – Sens_lr


# dspec = Spec_hr – Spec_lr

81
APPENDIX A

Intervalli di confidenza per dati appaiati secondo Wald, Wilson e Newcombe

Ado File mc_nemi


program mc_nemi
***************************************************
* Comparison of paired Test Results *
* Ref. Statistical Methods in Diagnostic Medicine *
* Xiao-Hau Zhou et al. *
* pag. 169 *
* Effettua un confronto esatto per dati appaiati *
* e con il test di Mc Nemar *
* Calcola inoltre l'intervallo di confidenza al *
* 95% della diffrerenza tra le proporzioni *
* secondo Wilson,Newcombe e Wald *
***************************************************
*!
*! Mc Nemar Analysis for comparing Sensitivities and Specificities of two diagnostic
*! procedures performed on the same group of patients
*! Autore: Silvano
*! 19/12/19
*! Sintassi: mc_nemi a b \ c d, 1(2)
*! Option 1 only diseased patients (Sensitivity)
*! Option 2 only NON diseased patients (Specificity)

82
*!
*! T1+ T1-
*! T2+ a b
*! T2- c d
*! SENS1=(a+c)/n SENS2=(a+b)/n
*! SPEC1=(b+d)/n SPEC2=(c+d)/n
*!
*! Hawass NE Comparing the sensitivities and specificities of two diagnostic procedures
*! performed on the same group of patients.
*! Br J Radiol. 1997 Apr;70(832):360-6
*!
version 13.1
if "`1'" == "?" {
which mc_nemi
exit
}
*
parse "`*'", parse(",\ ")
if `7'==1 |`7'==2{
di as text "Option `7'"
if `7'==1{
di as text "ONLY DISEASED PATIENTS -> SENSITIVITY"
local out1="SENS1"
local out2="SENS2"
}
else {
di as text "ONLY NON DISEASED PATIENTS -> SPECIFICITY"
local out1="SPEC1"
local out2="SPEC2"
}
tabi `1' `2' `3' `4' `5',matcell(T)
local m00=T[1,1]
local m10=T[2,1]
local m11=T[2,2]
local m01=T[1,2]
local m=`m10'+`m01'
local k=min(`m10',`m01')
local k1=`k'+1
local x=0
local nn=0
forvalues n=1(1)`k1'{
local nn=`n'
local x =`x'+comb(`m',(`nn'-1))*0.5^`m'
}
local p=2*`x'
local p=min(1,`p')
local X=((`m10'-`m01')^2)/(`m10'+`m01')
local pp=chi2tail(1,`X')
di as txt _dup(60) "-"
di as text " Comparison of Paired Test Results "
di as text " Probability exact test " as result `p'
di as text " Probability chi-square test " as result `pp'
if (`m10'+`m01')<20 {
di as text " Because the number of patients with differing test results"
di as text " is small (<20), using the exact test will be better!!!"
}
di as txt _dup(60) "-"
di as text " "
if `7'==1{
local e=`m00'
local f=`m10'
local g=`m01'
local h=`m11'
local n=`m00'+`m10'+`m01'+`m11'
}
else {
local e=`m00'
local f=`m01'
local g=`m10'
local h=`m11'
local n=`m00'+`m10'+`m01'+`m11'
}
if `7'==2{
local p2=(`g'+`h')/`n'
local p1=(`f'+`h')/`n'
}
else{
local p1=(`e'+`f')/`n'
83
Ponendo T =0 dalla (1.38) possiamo calcolare quel particolare valore di R, (R*) che renderebbe i due
test (singolo e combinato) interscambiabili.

(1 − θ ) π −+−
R* = (1.40)
θπ −+
+

Se l’R massimo tollerato fosse superiore a R* si opterebbe per il test combinato. Viceversa, se il valore
massimo di R tollerato fosse inferiore a R* si sceglierebbe il test singolo.

Utilizzando il delta method possiamo facilmente calcolare lo standard error asintotico di ln ( R* )

1−θ 
ln ( R * ) = ln   + ln (π − + ) − ln (π −+ )
+ −

 θ 
 1  π −+ (1 − π −+ )  1  π −+ (1 − π − + )
+ 2 + 2 − −

var ( R * ) = var  ln ( π −++ )  + var  ln (π −−+ )  =  +  + − 


 π −+  nM  π −+  nM

1 − π −+
+
1 − π −+

1 − π −+
+
1 − π −+

var ( R* ) = + → se ( ) π+ n π− n
R *
= + (1.41)
π −+
+
nM π −+ −
nM −+ M −+ M

Interpretazione AND ( A ∩ B )
I valori attesi addizionali dei veri positivi (TNA) e i valori attesi addizionali dei falsi negativi (FNA)
possono stimarsi con le (1.37):

TN A = π +−

= p+−− FN A = π +−
+ +
= p+− (1.42)

Se con R indichiamo il rapporto tra il numero di falsi negativi addizionali che siamo in grado di
sopportare in corrispondenza di ogni singolo vero negativo addizionale e con θ la prevalenza di malattia,
il valore di T, definito dalla (1.43), potrà essere utilizzato come cut-off

T = Rθπ ++− − (1 − θ ) π +−− (1.43)

se (T ) = R 2θ 2
π −+
+
(1 − π +−+ ) + (1 − θ )
2 π −+

(1 − π +−− ) (1.44)
nM nM

(1 − θ ) π +−−
R* = (1.45)
θπ +−
+

1 − π +−
+
1 − π +−

1 − π +−
+
1 − π +−

var ( R* ) = + → se ( R *
) = + (1.46)
π ++− nM π +−−
nM π +−
+
nM π +−− nM

Esempio 11

In Tab. 20 sono riassunti i dati di uno studio rivolto a una popolazione 364 donne sottoposte a colposcopia
per effetto di un Pap test anormale.7,14,15

Lo scopo dello studio consisteva nel verificare se l’aggiunta del test HPV, in combinazione con una ripetuta
analisi citologica (criterio OR), potesse essere utile dal punto di vista diagnostico.

45
*! Richiede l'installazione preliminare di un personal ADO: "diatest"
*! Version 1.0.2 29-01-2019
*! Author: Silvano Andorno
*
version 13.0
if "`1'" == "?" {
which pairtest
exit
}
*
syntax varlist (min=3 max=3) [if][in]
marksample touse
local x=0
foreach oldname of varlist `varlist'{
local oldname`x'="`oldname'"
local newname="X"+"`x'"
local newname`x'="X"+"`x'"
capture rename `oldname' `newname'
local x=`x'+1
local tt=`x'-1
}
local str1="Comparison of sensitivities of the two methods"
local str2="Comparison of specificities of the two methods"
local str3="Condition (0 healty) (1 sick); Test (0 negative) (1 positive)"
display as result "First Test"
rename X0 Test1
rename X2 Condition
diatest Condition Test1
display as text "`str3'"
rename Test1 X0
display
display as result "Second test"
rename X1 Test2
diatest Condition Test2
display as text "`str3'"
rename Test2 X1
rename Condition X2
qui:tabulate X0 X1 if X2==1,matcell(A1)
qui:tabulate X0 X1 if X2==0,matcell(B1)
local a11=A1[1,1]
local a12=A1[1,2]
local a21=A1[2,1]
local a22=A1[2,2]
*
local b11=B1[1,1]
local b12=B1[1,2]
local b21=B1[2,1]
local b22=B1[2,2]
*
display
local X2=((`a12'-`a21')^2/(`a12'+`a21'))+((`b12'-`b21')^2/(`b12'+`b21'))
local pp=chi2tail(2,`X2')
di as result "COMPARISON RESULTS"
display
display "OMNIBUS MATRIX"
*
local aa11=`a11'
local aa12="NA"
local aa13=`a12'
local aa14="NA"
*
local aa21="NA"
local aa22=`b11'
local aa23="NA"
local aa24=`b12'
*
local aa31=`a21'
local aa32="NA"
local aa33=`a22'
local aa34="NA"
*
local aa41="NA"
local aa42=`b21'
local aa43="NA"
local aa44=`b22'
*
local r1="TP"
local r2="FP"
85
Il risultato dell’HPV test è dicotomico (0 negativo; 1 positivo), mentre il Pap test fornisce la positività
graduata su tre valori (1-2-3; 0 test negativo):

1 ASUS (Atypical Squamous Cells of Undetermined Significance)


2 LSIL (Low grade Squamous Intraepithelial Lesion)
3 HSIL (High grade Squamous Intraepithelial Lesion)

Tab. 20 Cross-classified repeat cytologic (Pap) and HPV tests results within
categories of disease (n=364)
Disease M M=LSIL M=HSIL
Pap HPV+ HPV- HPV+ HPV- HPV+ HPV-
HSIL 2 2 2 1 28 12
LSIL 17 12 40 14 24 2
ASCUS 7 9 9 9 2 2
Normal 16 115 12 19 6 4
TOTAL 40 138 63 43 60 20

Si richiede di

1) Rappresentare su un piano ROC le performance diagnostiche della ripetizione del Pap Test, HPV Test
e il Test combinato P ∪ H per (a) disease=LSIL o HSIL; (b) disease=HSIL.

2) Rappresentare sempre su un piano ROC i likelihood ratio per il test singolo (Pap Test con risultato
dicotomico 0/1 (1=1,2,3) e il combinato P ∪ H quando: (a) disease=LSIL; (b) disease=HSIL.

Richiesta n.1

Riorganizziamo i dati di Tab.20

Tab. 21 Cross-classified repeat cytologic (Pap) and HPV tests results


P HPV M‡ W P HPV M# W
3 0 1 12 3 0 0 2
3 1 1 28 3 1 0 2
2 0 1 2 2 0 0 12
2 1 1 24 2 1 0 15
1 0 1 2 1 0 0 9
1 1 1 2 1 1 0 7
0 0 1 4 0 0 0 115
0 1 1 6 0 1 0 16
3 0 0 3 3 0 1 13
3 1 0 4 3 1 1 30
2 0 0 26 2 0 1 16
2 1 0 55 2 1 1 64
1 0 0 18 1 0 1 11
1 1 0 16 1 1 1 11
0 0 0 134 0 0 1 23
0 1 0 28 0 1 1 18
‡ M (disease) =HSIL # M(disease)= LSIL o HSIL

46
local e=`m11'
local f=`m01'
local g=`m10'
local h=`m00'
}
local A=1+1.96^2/`n'
local C=((`e'+`f')/`n')^2
local B=(2*(`e'+`f')/`n')+1.96^2/`n'
local CP=((`e'+`g')/`n')^2
local BP=(2*(`e'+`g')/`n')+1.96^2/`n'
local U2=(`B'+sqrt(`B'^2-4*`A'*`C'))/(2*`A')
local L2=(`B'-sqrt(`B'^2-4*`A'*`C'))/(2*`A')
local U3=(`BP'+sqrt(`BP'^2-4*`A'*`CP'))/(2*`A')
local L3=(`BP'-sqrt(`BP'^2-4*`A'*`CP'))/(2*`A')
local DPSI=sqrt((`e'+`f')*(`g'+`h')*(`e'+`g')*(`f'+`h'))
local PSI=0
if `DPSI'!=0 {
local PSI=(`e'*`h'-`f'*`g')/`DPSI'
}

local DL2=((`e'+`f')/`n')-`L2'
local DU2=`U2'- ((`e'+`f')/`n')
local DL3=((`e'+`g')/`n')-`L3'
local DU3=`U3'- ((`e'+`g')/`n')
local DELTA=sqrt(`DL2'^2-2*`PSI'*`DU3'*`DL2'+`DU3'^2)
local EPSI=sqrt(`DU2'^2-2*`PSI'*`DU2'*`DL3'+`DL3'^2)
local theta=(`f'-`g')/`n'
local LL=`theta'-`DELTA'
local UL=`theta'+`EPSI'
local NPSI=(`e'*`h'-`f'*`g')

if `e'*`h'>`f'*`g' {
local NPSI=max((`e'*`h'-`f'*`g'-(`n'/2)),0)
}
local PSIC=`NPSI'/`DPSI'
if `DPSI'==0 {
local PSIC=0
}
local DELTAN=sqrt(`DL2'^2-2*`PSIC'*`DL2'*`DU3'+`DU3'^2)
local EPSIN=sqrt(`DU2'^2-2*`PSIC'*`DU2'*`DL3'+`DL3'^2)
local LLN=`theta'-`DELTAN'
local ULN=`theta'+`EPSIN'
local ULA=`theta'+1.96*(1/`n')*sqrt(`g'+`f'-(`g'-`f')^2/`n')
local LLA=`theta'-1.96*(1/`n')*sqrt(`g'+`f'-(`g'-`f')^2/`n')
di as txt _newline _dup(50) "-"
di as text " CI(95%) Wilson " as result `LL' _col(30) as text " " as result `UL'
di as text " CI(95%) Newcombe " as result `LLN' _col(30) as text " " as result `ULN'
di as text " CI(95%) Wald " as result `LLA' _col(30) as text " " as result `ULA'
di as txt _dup(50) "-"
display
}
else {
display "MATRICE NON CONFORME"
}
}
forvalue y=0(1)2{
capture rename `newname`y'' `oldname`y''
}
end

Ado Fila diatest.ado


program diatest
version 13.1
syntax varlist (max=2 min=2) [if][in],
marksample touse
local x=1
foreach oldname of varlist `varlist'{
local oldname`x'="`oldname'"
local newname="var"+"`x'"
local newname`x'="var"+"`x'"
capture rename `oldname' `newname'
local x=`x'+1
local tt=`x'-1
}
qui:tabulate var1 var2,matcell(A)
87
Calcoliamo SEN e SPEC considerando M = HSIL
use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_1.dta", clear
expand W
cls
gen t=0
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i'
diatest M t
}
*
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i' | HPV==1
diatest M t
}
t = 1 if P >= 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 162 122 | 284
1 | 10 70 | 80
-----------+----------------------+----------
Total | 172 192 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.875 0.803 0.947 0.782 0.938 0.785 0.931
SPEC 0.570 0.513 0.628 0.511 0.629 0.512 0.627
PPV 0.365 0.297 0.433 0.296 0.437 0.300 0.435
NPV 0.942 0.907 0.977 0.896 0.972 0.896 0.968
LR+ 2.037 1.740 2.384
LR- 0.219 0.122 0.395
----------------------------------------------------------------------

Youden index = 0.445 95%CI ( 0.353- 0.538) Normal Approximation


95%CI ( 0.339- 0.526) Wilson's Approximation
t = 1 if P >= 2

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 196 88 | 284
1 | 14 66 | 80
-----------+----------------------+----------
Total | 210 154 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.825 0.742 0.908 0.724 0.901 0.727 0.893
SPEC 0.690 0.636 0.744 0.633 0.743 0.634 0.741
PPV 0.429 0.350 0.507 0.349 0.511 0.353 0.508
NPV 0.933 0.900 0.967 0.891 0.963 0.891 0.960
LR+ 2.663 2.178 3.255
LR- 0.254 0.157 0.411
----------------------------------------------------------------------

Youden index = 0.515 95%CI ( 0.416- 0.614) Normal Approximation


95%CI ( 0.405- 0.603) Wilson's Approximation
t = 1 if P >= 3
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 277 7 | 284
1 | 40 40 | 80
-----------+----------------------+----------
Total | 317 47 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.500 0.390 0.610 0.386 0.614 0.393 0.607
SPEC 0.975 0.957 0.993 0.950 0.990 0.950 0.988
PPV 0.851 0.749 0.953 0.717 0.938 0.723 0.926
NPV 0.874 0.837 0.910 0.832 0.908 0.833 0.906
LR+ 20.286 9.452 43.539
47
local llLRN=exp(log(`LRN')-1.96*sqrt((1-`p1n')/(`p1n'*`n1')+(1-`p2n')/(`p2n'*`n2')))
local ulLRN=exp(log(`LRN')+1.96*sqrt((1-`p1n')/(`p1n'*`n1')+(1-`p2n')/(`p2n'*`n2')))

************************************ OUTPUT **********************************************


display as text _col(2)"Index" _col(13)"Value" _col(24) "CI(95%) Wald" _col(40) "CI(95%) Exact"
_col(56) "CI(95%) Wilson"
display as text "{hline 70}"
display as text _col(3)"SENS" _col(12) as result %6.3f `sens' as result _col(22) %6.3f `llsens' as
result _col(30)%6.3f `ulsens' as result _col(38) %6.3f `llsense' as result _col(47)%6.3f `ulsense'
as result _col(55) %6.3f `llsensw' as result _col(64)%6.3f `ulsensw'
display as text _col(3)"SPEC" _col(12) as result %6.3f `spec' as result _col(22) %6.3f `llspec' as
result _col(30)%6.3f `ulspec' as result _col(38) %6.3f `llspece' as result _col(47)%6.3f `ulspece'
as result _col(55) %6.3f `llspecw' as result _col(64)%6.3f `ulspecw'
display as text _col(3)"PPV" _col(12) as result %6.3f `vpp' as result _col(22) %6.3f `llvpp' as
result _col(30)%6.3f `ulvpp' as result _col(38) %6.3f `llvppe' as result _col(47)%6.3f `ulvppe' as
result _col(55) %6.3f `llvppw' as result _col(64)%6.3f `ulvppw'
display as text _col(3)"NPV" _col(12) as result %6.3f `vpn' as result _col(22) %6.3f `llvpn' as
result _col(30)%6.3f `ulvpn' as result _col(38) %6.3f `llvpne' as result _col(47)%6.3f `ulvpne' as
result _col(55) %6.3f `llvpnw' as result _col(64)%6.3f `ulvpnw'
display as text _col(3)"LR+" _col(12) as result %6.3f `LRP' as result _col(22) %6.3f `llLRP' as
result _col(30)%6.3f `ulLRP'
display as text _col(3)"LR-" _col(12) as result %6.3f `LRN' as result _col(22) %6.3f `llLRN' as
result _col(30)%6.3f `ulLRN'
display as text "{hline 70}"
display " "
local sey=sqrt(A[1,1]*A[1,2]/(A[1,1]+A[1,2])^3 +A[2,1]*A[2,2]/(A[2,1]+A[2,2])^3)
local youd=`sens'+`spec'-1
local ulyoud=`youd'+1.96*`sey'
local llyoud=`youd'-1.96*`sey'
local A=1.96*sqrt((`llsensw'*(1-`llsensw')/`mm')+(`ulspecw'*(1-`ulspecw')/`nn'))
local B=1.96*sqrt((`ulsensw'*(1-`ulsensw')/`mm')+(`llspecw'*(1-`llspecw')/`nn'))
local llyouw=`youd'-`A'
local ulyouw=`youd'+`B'
display "Youden index = " as result %6.3f `sens'+`spec'-1 as result _col(27)"95%CI " "(" as result
_col(34) %6.3f `llyoud' as result _col(40) "-" as result _col(41) %6.3f `ulyoud' ")" ///
_col(50) "Normal Approximation"
display as result _col(27)"95%CI " "(" as result _col(34) %6.3f `llyouw' as result _col(40) "-" as
result _col(41) %6.3f `ulyouw' ")" ///
_col(50) "Wilson's Approximation"
}
else {
display "MATRICE NON CONFORME"
}
end

Ado Fila diatesti,ado


rogram diatesti

parse "`*'", parse(",\ ")


tabi `1' `2' `3' `4' `5',matcell(A)

*
*********** Calcolo SENS SPEC VPP VPN LRP LRN E CI95% ********
* SENS
local x1=A[2,2]
local x2=(A[2,1]+A[2,2])
quietly: cii `x2' `x1',wald
local mm=`x2'
local sens=r(mean)
local llsens=r(lb)
local ulsens=r(ub)
quietly: cii `x2' `x1',exact
local llsense=r(lb)
local ulsense=r(ub)
quietly: cii `x2' `x1',wilson
local llsensw=r(lb)
local ulsensw=r(ub)
* SPEC
local x1=A[1,1]
local x2=(A[1,1]+A[1,2])
quietly:cii `x2' `x1',wald
local nn=`x2'
local spec=r(mean)
local llspec=r(lb)
local ulspec=r(ub)
89
LR- 0.513 0.411 0.639
----------------------------------------------------------------------

Youden index = 0.475 95%CI ( 0.364- 0.586) Normal Approximation


95%CI ( 0.368- 0.585) Wilson's Approximation

. *
. forvalues i=1(1)3{
2. replace t=0
3. replace t=1 if P>=`i' | HPV==1
4. diatest M t
5. }

t = 1 if P >= 1 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 134 150 | 284
1 | 4 76 | 80
-----------+----------------------+----------
Total | 138 226 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.950 0.902 0.998 0.877 0.986 0.878 0.980
SPEC 0.472 0.414 0.530 0.413 0.532 0.415 0.530
PPV 0.336 0.275 0.398 0.275 0.402 0.278 0.400
NPV 0.971 0.943 0.999 0.927 0.992 0.928 0.989
LR+ 1.799 1.594 2.030
LR- 0.106 0.040 0.278
----------------------------------------------------------------------

Youden index = 0.422 95%CI ( 0.347- 0.497) Normal Approximation


95%CI ( 0.330- 0.487) Wilson's Approximation
t = 1 if P >= 2 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 152 132 | 284
1 | 6 74 | 80
-----------+----------------------+----------
Total | 158 206 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.925 0.867 0.983 0.844 0.972 0.846 0.965
SPEC 0.535 0.477 0.593 0.475 0.594 0.477 0.592
PPV 0.359 0.294 0.425 0.294 0.429 0.297 0.427
NPV 0.962 0.932 0.992 0.919 0.986 0.920 0.982
LR+ 1.990 1.731 2.288
LR- 0.140 0.064 0.305
----------------------------------------------------------------------

Youden index = 0.460 95%CI ( 0.378- 0.542) Normal Approximation


95%CI ( 0.363- 0.531) Wilson's Approximation
t = 1 if P >= 3 ∨ HPV = 1
| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 178 106 | 284
1 | 8 72 | 80
-----------+----------------------+----------
Total | 186 178 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.900 0.834 0.966 0.812 0.956 0.815 0.948
SPEC 0.627 0.571 0.683 0.568 0.683 0.569 0.681
PPV 0.404 0.332 0.477 0.332 0.480 0.335 0.478
NPV 0.957 0.928 0.986 0.917 0.981 0.917 0.978
LR+ 2.411 2.039 2.851
LR- 0.160 0.082 0.310
----------------------------------------------------------------------

Youden index = 0.527 95%CI ( 0.440- 0.613) Normal Approximation


95%CI ( 0.426- 0.602) Wilson's Approximation

48
local ulyouw=`youd'+`B'
display "Youden index = " as result %6.3f `sens'+`spec'-1 as result _col(27)"95%CI " "(" as result
_col(34) %6.3f `llyoud' as result _col(40) "-" as result _col(41) %6.3f `ulyoud' ")" ///
_col(50) "Normal Approximation"
display as result _col(27)"95%CI " "(" as result _col(34) %6.3f `llyouw' as result _col(40) "-" as
result _col(41) %6.3f `ulyouw' ")" ///
_col(50) "Wilson's Approximation"

end

91
t = 1 if HPV = 1

. diatest M HPV

| HPV
M | 0 1 | Total
-----------+----------------------+----------
0 | 181 103 | 284
1 | 20 60 | 80
-----------+----------------------+----------
Total | 201 163 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.750 0.655 0.845 0.641 0.840 0.645 0.832
SPEC 0.637 0.581 0.693 0.578 0.693 0.580 0.691
PPV 0.368 0.294 0.442 0.294 0.447 0.298 0.444
NPV 0.900 0.859 0.942 0.851 0.938 0.851 0.935
LR+ 2.068 1.694 2.524
LR- 0.392 0.266 0.579
----------------------------------------------------------------------

Youden index = 0.387 95%CI ( 0.277- 0.497) Normal Approximation


95%CI ( 0.270- 0.487) Wilson's Approximation
Calcoliamo SEN e SPEC considerando M = HSIL oppure LSIL

use "C:\Users\silva\Google Drive\Diagnostc Test\example_gain_2.dta", clear


cls
gen t=0
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i'
diatest M t
}
*
forvalues i=1(1)3{
replace t=0
replace t=1 if P>=`i' | HPV==1
diatest M t
}
t = 1 if P >= 1

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 131 47 | 178
1 | 41 145 | 186
-----------+----------------------+----------
Total | 172 192 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


----------------------------------------------------------------------
SENS 0.780 0.720 0.839 0.713 0.837 0.715 0.833
SPEC 0.736 0.671 0.801 0.665 0.799 0.667 0.795
PPV 0.755 0.694 0.816 0.688 0.814 0.690 0.811
NPV 0.762 0.698 0.825 0.691 0.823 0.693 0.819
LR+ 2.952 2.284 3.817
LR- 0.300 0.225 0.398
----------------------------------------------------------------------

Youden index = 0.516 95%CI ( 0.428- 0.604) Normal Approximation


95%CI ( 0.428- 0.603) Wilson's Approximation
t = 1 if P >= 2

| t
M | 0 1 | Total
-----------+----------------------+----------
0 | 147 31 | 178
1 | 63 123 | 186
-----------+----------------------+----------
Total | 210 154 | 364

Index Value CI(95%) Wald CI(95%) Exact CI(95%) Wilson


49
19 Lin SC Some results on combinations of two binary screening tests. J Biopharm Stat. 1999 Mar;9(1):81-8.
20 Shoukri MM, Martin SW, Mian IU. Maximum likelihood estimation of the kappa coefficient from models of matched
binary responses. Stat Med. 1995 Jan 15;14(1):83-99.
21 Coughlin SS, Trock B, Criqui MH, Pickle LW, Browner D, Tefft MC. The logistic modeling of sensitivity,
specificity, and predictive value of a diagnostic test. J Clin Epidemiol. 1992 Jan;45(1):1-7.
22 Cruz-Correa M, Schultz K, Jagannath S, Harris M, Kantsevoy S, Bedine M, Kalloo AN. Performance
characteristics and comparison of two fecal occult blood tests in patients undergoing colonoscopy. Dig Dis Sci. 2007
Apr;52(4):1009-13. Epub 2007 Feb 16.

93

Potrebbero piacerti anche