Relation of Diagnostic Accuracy Measures

Theodora Chatzimichail, MD  
tc@hcsl.com
Aristides T. Hatjimihail, MD, PhD
 ath@hcsl.com

Hellenic Complex Systems Laboratory, Kostis Palamas 21, 66131 Drama, Greece.

Initialization Code

spec[x_,μD_,μH_,σD_,σH_,pd_]:=
CDF[NormalDistribution[μH,σH],InverseCDF[NormalDistribution[μD,σD],1-x]]

ppv[x_,μD_,μH_,σD_,σH_,pd_]:=((x pd)/(x pd+(1-spec[x,μD,μH,σD,σH,pd])(1-pd)))

npv[x_,μD_,μH_,σD_,σH_,pd_]:=(((spec[x,μD,μH,σD,σH,pd](1-pd)))/(spec[x,μD,μH,σD,σH,pd](1-pd)+(1-x)pd))

or[x_,μD_,μH_,σD_,σH_,pd_]:=((x/(1-x))/((1-spec[x,μD,μH,σD,σH,pd])/(spec[x,μD,μH,σD,σH,pd])))

plr[x_,μD_,μH_,σD_,σH_,pd_]:=(x/(1-spec[x,μD,μH,σD,σH,pd]))

nlr[x_,μD_,μH_,σD_,σH_,pd_]:=((1-x)/(spec[x,μD,μH,σD,σH,pd]))

txt[f_]:=Switch[f,ppv,"PPV",npv,"NPV",or,"OR",plr,"LR+",nlr,"LR-"]

pp[fb_,fa_,{x_,μD_,μH_,σD_,σH_,pd_}]:=Text@Quiet@Labeled[Quiet@ParametricPlot[{fa@@{x,μD,μH,σD,σH,pd},fb@@{x,μD,μH,σD,σH,pd}},{x,0.001,0.999},Exclusions->"Singularities",AspectRatio->1,AxesLabel->{txt[fa],txt[fb]},PlotStyle->{RGBColor[1,.47,0]} ,ImageSize->1.125{350,375}], txt[fb]<>" versus "<> txt[fa]<>" curve",Top]

Manipulate[
pp[fa,fb,{x,μD,μH,σD,σH,pd}],
{{fa,ppv,"plot"},{ppv->"PPV",npv->"NPV",or->"OR",plr->"LR+",nlr-> "LR-"},ControlPlacement->Top},
{{fb,npv,"versus"},{ppv->"PPV",npv->"NPV",or->"OR",plr->"LR+",nlr-> "LR-"},ControlPlacement->Top},
"",
Style["prevalence of disease",Bold],
{{pd,0.05,"prevalence"},0.00000001,.99,ImageSize->Tiny,Appearance->"Labeled"},
"",
Style["nondiseased population",Bold],
{{μH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{σH,1,"standard deviation"},0.01,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
"",
Style["diseased population",Bold],
{{μD,3.67,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{σD,1,"standard deviation"},0.01,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
SaveDefinitions->True,AutorunSequencing->{1,2,6},TrackedSymbols->True,ControlPlacement->Left]

Description

This Demonstration examines the relation of pairs of accuracy measures of diagnostic tests applied on normally distributed nondiseased and diseased populations. This is done for differing prevalence of the disease, taking into account the means and standard deviations of the populations. The means and standard deviations are expressed in arbitrary units. The measures considered are the positive predictive value ("PPV"), the negative predictive value ("NPV"), the (diagnostic) odds ratio ("OR"), the likelihood ratio for a positive result ("LR+") and the likelihood ratio for a negative result ("LR-"). The measures can be selected by clicking the respective "plot" and "versus" buttons.

Snapshots

Details

These measures of the clinical accuracy of a diagnostic test applied to a diseased and a nondiseased population can be calculated as functions of the sensitivity and the specificity of the test. Sensitivity is the fraction of the diseased population with a positive test result, while specificity is the fraction of the nondiseased population with a negative test result. If we denote by sens the sensitivity, spec the specificity and pr the prevalence, we have:

PPV=((sens×pr)/(sens×pr+(1-spec)(1-pr))),

NPV=((spec(1-pr))/(spec(1-pr)+(1-sens)pr)),

OR=(sens/(1-sens))/((1-spec)/spec),

LR+ =(sens/(1-spec)),

LR- =((1-sens)/spec).

Given a diseased and a nondiseased population, the specificity can be defined as a function of sensitivity; therefore, we can generate the parametric plots of any pair of the diagnostic accuracy measures.

To the best of our knowledge, with the exception of the pair PPV and NPV [1, 2], the relation of any other pair of the given diagnostic accuracy measures has not been discussed in the literature.

In the thumbnail, the population data describes a bimodal distribution of serum glucose measurements in nondiabetic and diabetic populations [3].

This Demonstration is an extended version of another Demonstration [2], first published in 2015, and is appropriate as an educational tool for medical students and as an exploratory research tool in diagnostic accuracy studies.

References

[1] S.-Y. Shiu and C. Gatsonis, "The Predictive Receiver Operating Characteristic Curve for the Joint Assessment of the Positive and Negative Predictive Values," Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 366(1874), 2008 pp. 2313–2333. doi:10.1098/rsta.2008.0043.

[2] T. Chatzimichail. "Correlation of Positive and Negative Predictive Values of Diagnostic Tests" from the Wolfram Demonstrations Project—A Wolfram Web Resource. demonstrations.wolfram.com/CorrelationOfPositiveAndNegativePredictiveValuesOfDiagnostic.

[3] T.-O. Lim, R. Bakri, Z. Morad and M. A. Hamid, "Bimodality in Blood Glucose Distribution: Is It Universal?," Diabetes Care, 25(12), 2002 pp. 2212–2217. doi:10.2337/diacare.25.12.2212.

Keywords

sensitivity
specificity
diagnostic test
clinical accuracy
diagnostic accuracy
normal distribution
binormal distribution
positive predictive value
negative predictive value
likelihood ratio
odds ratio

Related Links

Correlation of Positive and Negative Predictive Values of Diagnostic Tests

Disclaimer of Warranties

The notebook is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or Hellenic Complex Systems Laboratory or any of its members be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the notebook or the use or other dealings in the notebook.

About

Relation of Diagnostic Accuracy Measures
Version Number 1.1.0
Hellenic Complex Systems Laboratory 2021
First published at Wolfram Demonstrations Project at: (HyperlinkURL["demonstrations.wolfram.com/RelationOfDiagnosticAccuracyMeasures/", https://demonstrations.wolfram.com/RelationOfDiagnosticAccuracyMeasures/])
The notebook is distributed under  an Attribution - NonCommercial - ShareAlike 4.0 International Creative Commons License.