Equations
nr1 = a+b
nr2 = c+d
nc1 = a+c
nc2 = b+d
N = a + b + c + d
z = 1.959964
Diagnostic Test1,2,3
Sensitivity
Sensitivity = a/nc1
Lower limit = ((2×a) + z2 – z√( ( 4×a×c / nc1 ) + z2 )) / ((2×nc1) + (2×z2))
Upper limit = ((2×a) + z2 + z√( ( 4×a×c / nc1 ) + z2 )) / ((2×nc1) + (2×z2))
Specificity
Specificity = d/nc2
Lower limit = ((2×d) + z2 – z√( ( 4×d×b / nc2 ) + z2 )) / ((2×nc2) + (2×z2))
Upper limit = ((2×d) + z2 + z√( ( 4×d×b / nc2 ) + z2 )) / ((2×nc2) + (2×z2))
Positive Predictive Value (PPV)
PPV = a/nr1
Lower limit = ((2×a) + z2 – z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
Upper limit = ((2×a) + z2 + z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
Negative Predictive Value (NPV)
NPV = d/nr2
Lower limit = ((2×d) + z2 – z√( ( 4×d×c / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
Upper limit = ((2×d) + z2 + z√( ( 4×d×c / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
Likelihood Ratio +
LR+ = Sensitivity / (1 – Specificity)
Lower limit = exp ( ln( (nc2×a)/(nc1×b) ) – z√( ( c/(a×nc1) ) + ( d/(b×nc2) ) ) )
Upper limit = exp ( ln( (nc2×a)/(nc1×b) ) + z√( ( c/(a×nc1)) + ( d/(b×nc2) ) ) )
Likelihood Ratio –
LR+ = (1 – Sensitivity) / Specificity
Lower limit = exp ( ln( (nc2×c)/(nc1×d) ) – z√( ( a/(c×nc1) ) + ( b/(d×nc2) ) ) )
Upper limit = exp ( ln( (nc2×c)/(nc1×d) ) + z√( ( a/(c×nc1)) + ( b/(d×nc2) ) ) )
Pre-test Probability by Post-test Probability Plot
Plot PretestProb by PosttestProb(+) and PretestProb by PosttestProb(-).
PretestProb = a vector of values from 0 to 1.0 by 0.001 increments
PosttestProb(+) = (PretestOdds × LR+) / (1 + (PretestOdds × LR+))
PosttestProb(-) = (PretestOdds × LR-) / (1 + (PretestOdds × LR-))
where…
PretestOdds = PretestProb / (1 – PretestProb)
Prospective Study4, 5, 6
Chi-squared
Chi-squared = (N × ( | (a×d) – (b×c) | – (N / 2))2) / (nr1 × nr2 × nc1 × nc2)
p-value = Chi-squared density at 1 degree of freedom
Relative Risk (RR)
RR = (a × (c+d)) / (c × (a+b))
Lower limit = exp ( ln(RR) – z√( (1/c) – (1/(c+d)) + (1/a) – (1/(a+b)) )
Upper limit = exp ( ln(RR) + z√( (1/c) – (1/(c+d)) + (1/a) – (1/(a+b)) )
Absolute Risk Reduction (ARR)
ARR = (c/(c+d)) – (a/(a+b))
Lower limit = ARR – z√( (u2×(1-u2) / (a+b)) + (w1×(1-w1) / (c+d)) )
Upper limit = ARR + z√( (u1×(1-u1) / (c+d)) + (w2×(1-w2) / (a+b)) )
where…
u1 = ((2×c) + z2 + z√( ( 4×c×d / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
u2 = ((2×a) + z2 + z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
w1 = ((2×c) + z2 – z√( ( 4×c×d / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
w2 = ((2×a) + z2 – z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
Number Needed to Treat (NNT)
NNT = 1/ARR (rounded down to 0 decimal places)
Lower limit = 1 / ARR lower limit (rounded to 0 decimal places)
Upper limit = 1 / ARR upper limit (rounded to 0 decimal places)
Case-Control Study4,7
Chi-squared
Chi-squared = (N × ( | (a×d) – (b×c) | – (N / 2))2) / (nr1 × nr2 × nc1 × nc2)
p-value = Chi-squared density at 1 degree of freedom
Odds Ratio (OR)
OR = (a × d) / (b × c)
Lower limit = exp ( ln(OR) – z√( (1/a) + (1/b) + (1/c) + (1/d) )
Upper limit = exp ( ln(OR) + z√( (1/a) + (1/b) + (1/c) + (1/d) )
Randomized Controlled Trial (RCT)4,6
Chi-squared
Chi-squared = (N × ( | (a×d) – (b×c) | – (N / 2))2) / (nr1 × nr2 × nc1 × nc2)
p-value = Chi-squared density at 1 degree of freedom
Relative Risk Reduction (RRR)
RRR = ((c / (c+d)) – (a / (a+b))) / (c / (c+d))
Lower limit = 1 – ( exp( ln( (a × (c+d)) / (c × (a+b)) ) + z√( (1/c) – (1/(c+d)) + (1/a) – (1/(a+b)) ) ) )
Upper limit = 1 – ( exp( ln( (a × (c+d)) / (c × (a+b)) ) – z√( (1/c) – (1/(c+d)) + (1/a) – (1/(a+b)) ) ) )
Absolute Risk Reduction (ARR)
ARR = (c/(c+d)) – (a/(a+b))
Lower limit = ARR – z√( (u2×(1-u2) / (a+b)) + (w1×(1-w1) / (c+d)) )
Upper limit = ARR + z√( (u1×(1-u1) / (c+d)) + (w2×(1-w2) / (a+b)) )
where…
u1 = ((2×c) + z2 + z√( ( 4×c×d / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
u2 = ((2×a) + z2 + z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
w1 = ((2×c) + z2 – z√( ( 4×c×d / nr2 ) + z2 )) / ((2×nr2) + (2×z2))
w2 = ((2×a) + z2 – z√( ( 4×a×b / nr1 ) + z2 )) / ((2×nr1) + (2×z2))
Number Needed to Treat (NNT)
NNT = 1/ARR (rounded down to 0 decimal places)
Lower limit = 1 / ARR lower limit (rounded to 0 decimal places)
Upper limit = 1 / ARR upper limit (rounded to 0 decimal places)
References
For full references, see the Credits & References section.
-
Wilson (1927)
95% confidence interval for sensitivity, specificity, PPV and NPV
-
Newcombe (1998a)
95% confidence interval for sensitivity, specificity, PPV and NPV
-
Simel et al (1991)
95% confidence interval for LR+ and LR-
-
Yates (1934)
Chi-squared
-
Armitage & Berry (1994)
95% confidence interval for RR
-
Newcombe (1998b)
95% confidence interval for ARR
-
Bland & Altman (2000)
95% confidence interval for OR