Equations
nr1 = a+b
nr2 = c+d
nc1 = a+c
nc2 = b+d
N = a + b + c + d
z = 1.959964
Diagnostic Test^{1,2,3}
Sensitivity
Sensitivity = a/nc1
Lower limit = ((2×a) + z^{2}  z√( ( 4×a×c / nc1 ) + z^{2} )) / ((2×nc1) + (2×z^{2}))
Upper limit = ((2×a) + z^{2} + z√( ( 4×a×c / nc1 ) + z^{2} )) / ((2×nc1) + (2×z^{2}))
Specificity
Specificity = d/nc2
Lower limit = ((2×d) + z^{2}  z√( ( 4×d×b / nc2 ) + z^{2} )) / ((2×nc2) + (2×z^{2}))
Upper limit = ((2×d) + z^{2} + z√( ( 4×d×b / nc2 ) + z^{2} )) / ((2×nc2) + (2×z^{2}))
Positive Predictive Value (PPV)
PPV = a/nr1
Lower limit = ((2×a) + z^{2}  z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
Upper limit = ((2×a) + z^{2} + z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
Negative Predictive Value (NPV)
NPV = d/nr2
Lower limit = ((2×d) + z^{2}  z√( ( 4×d×c / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
Upper limit = ((2×d) + z^{2} + z√( ( 4×d×c / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
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) ) ) )
Pretest Probability by Posttest 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 Study^{4, 5, 6}
Chisquared
Chisquared = (N × (  (a×d)  (b×c)   (N / 2))^{2}) / (nr1 × nr2 × nc1 × nc2)
pvalue = Chisquared 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×(1u2) / (a+b)) + (w1×(1w1) / (c+d)) )
Upper limit = ARR + z√( (u1×(1u1) / (c+d)) + (w2×(1w2) / (a+b)) )
where...
u1 = ((2×c) + z^{2} + z√( ( 4×c×d / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
u2 = ((2×a) + z^{2} + z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
w1 = ((2×c) + z^{2}  z√( ( 4×c×d / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
w2 = ((2×a) + z^{2}  z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
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)
CaseControl Study^{4,7}
Chisquared
Chisquared = (N × (  (a×d)  (b×c)   (N / 2))^{2}) / (nr1 × nr2 × nc1 × nc2)
pvalue = Chisquared 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}
Chisquared
Chisquared = (N × (  (a×d)  (b×c)   (N / 2))^{2}) / (nr1 × nr2 × nc1 × nc2)
pvalue = Chisquared 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×(1u2) / (a+b)) + (w1×(1w1) / (c+d)) )
Upper limit = ARR + z√( (u1×(1u1) / (c+d)) + (w2×(1w2) / (a+b)) )
where...
u1 = ((2×c) + z^{2} + z√( ( 4×c×d / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
u2 = ((2×a) + z^{2} + z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
w1 = ((2×c) + z^{2}  z√( ( 4×c×d / nr2 ) + z^{2} )) / ((2×nr2) + (2×z^{2}))
w2 = ((2×a) + z^{2}  z√( ( 4×a×b / nr1 ) + z^{2} )) / ((2×nr1) + (2×z^{2}))
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)
Chisquared

Armitage & Berry (1994)
95% confidence interval for RR

Newcombe (1998b)
95% confidence interval for ARR

Bland & Altman (2000)
95% confidence interval for OR