of sick people in the data set is equal to tp + fn, or 32 + 3 = 35. the sensitivity is therefor 32 / 35 = 91.4%. using the same method, we get tn = 40 - 3 = 37, and the number of healthy people 37 + 8 = 45, which results in a specificity of 37 / 45 = 82.2 %. for the figure that shows low sensitivity and high specificity, there are 8 fn and 3 fp. using the same method as the previous figure, we get tp = 40 - 3 = 37. the number of sick people is 37 + 8 = 45, which gives a sensitivity of 37 / 45 = 82.2 %. there are 40 - 8 = 32 tn. the specificity therefor comes out to 32 / 35 = 91.4%. a test result with 100 percent sensitivity. a test result with 100 percent specificity. the red dot indicates the patient with the medical condition. the red background indicates the area where the test predicts the data point to be positive. the true positive in this figure is 6, and false negatives of 0 (because all positive condition is correctly predicted as positive). therefore, the sensitivity is 100% (from 6 / (6 + 0)). this situation is also illustrated in the previous figure where the dotted line is at position a (the left-hand side is predicted as negative by the model, the right-hand side is predicted as positive by the model). when the dotted line, test cut-off line, is at position a, the test correctly predicts all the population of the true positive class, but it will fail to correctly identify the data point from the true negative class. similar to the previously explained figure, the red dot indicates the patient with the medical condition. however, in this case, the green background indicates that the test predicts that all patients are free of the medical condition. the number of data point that is true negative is then 26, and the number of false positives is 0. this result in 100% specificity (from 26 / (26 + 0)). therefore, sensitivity or specificity alone cannot be used to measure the performance of the test. medical usage in medical diagnosis, test sensitivity is the ability of a test to correctly identify those with the disease (true positive rate), whereas test specificity is the ability of the test to correctly identify those without the disease (true negative rate). if 100 patients known to have a disease were tested, and 43 test positive, then the test has 43% sensitivity. if 100 with no disease are tested and 96 return a completely negative result, then the test has 96% specificity. sensitivity and specificity are prevalence-independent test characteristics, as their values are intrinsic to the test and do not depend on the disease prevalence in the population of interest. positive and negative predictive values, but not sensitivity or specificity, are values influenced by the prevalence of disease in the population that is being tested. these concepts are illustrated graphically in this applet bayesian clinical diagnostic model which show the positive and negative predictive values as a function of the prevalence, sensitivity and specificity. misconceptions it is often claimed that a highly specific test is effective at ruling in a disease when positive, while a highly sensitive test is deemed effective at ruling out a disease when negative. this has led to the widely used mnemonics sppin and snnout, according to which a highly specific test, when positive, rules in disease (sp-p-in), and a highly sensitive test, when negative, rules out disease (sn-n-out). both rules of thumb are, however, inferentially misleading, as the diagnostic power of any test is determined by both its sensitivity and its specificity. the tradeoff between specificity and sensitivity is explored in roc analysis as a trade off between tpr and fpr (that is, recall and fallout). giving them equal weight optimizes informedness = specificity + sensitivity − 1 = tpr − fpr, the magnitude of which gives the probability of an informed decision between the two classes (> 0 represents appropriate use of information, 0 represents chance-level performance, < 0 represents perverse use of information). sensitivity index the sensitivity index or d′ (pronounced "dee-prime") is a statistic used in signal detection theory. it provides the separation between the means of the signal and the noise distributions, compared against the standard deviation of the noise distribution. for normally distributed signal and noise with mean and standard deviations μ s and σ s , and μ n and σ n , respectively, d′ is defined as: d ′ = μ s − μ n 1 2 ( σ s 2 + σ n 2 ) =-\mu _\left(\sigma _^+\sigma _^\right)}}}} an estimate of d′ can be also found from measurements of the hit rate and false-alarm rate. it is calculated as: d′ = z(hit rate) − z(false alarm rate), where function z(p), p ∈ , is the inverse of the cumulative gaussian distribution. d′ is a dimensionless statistic. a higher d′ indicates that the signal can be more readily detected. confusion matrix the relationship between sensitivity, specificity, and similar terms can be understood using the following table. consider a group with p positive instances and n negative instances of some condition. the four outcomes can be formulated in a 2×2 contingency table or confusion matrix, as well as derivations of several metrics using the four outcomes, as follows: predicted condition sources: total population = p + n positive (pp) negative (pn) informedness, bookmaker informedness (bm) = tpr + tnr − 1 prevalence threshold (pt) = tpr × fpr − fpr tpr − fpr \times -- actual condition positive (p) true positive (tp), hit false negative (fn), type ii error, miss, underestimation true positive rate (tpr), recall, sensitivity (sen), probability of detection, hit rate, power = tp/p = 1 − fnr false negative rate (fnr), miss rate = fn/p = 1 − tpr negative (n) false positive (fp), type i error, false alarm, overestimation true negative (tn), correct rejection false positive rate (fpr), probability of false alarm, fall-out = fp/n = 1 − tnr true negative rate (tnr), specificity (spc), selectivity = tn/n = 1 − fpr prevalence = p/p + n positive predictive value (ppv), precision = tp/pp = 1 − fdr false omission rate (for) = fn/pn = 1 − npv positive likelihood ratio (lr+) = tpr/fpr negative likelihood ratio (lr−) = fnr/tnr accuracy (acc) = tp + tn/p + n false discovery rate (fdr) = fp/pp = 1 − ppv negative predictive value (npv) = tn/pn = 1 − for markedness (mk), deltap (δp) = ppv + npv − 1 diagnostic odds ratio (dor) = lr+/lr− balanced accuracy (ba) = tpr + tnr/2 f1 score = 2 ppv × tpr/ppv + tpr = 2 tp/2 tp + fp + fn fowlkes–mallows index (fm) = ppv × tpr \times matthews correlation coefficient (mcc) = tpr × tnr × ppv × npv \times \times \times − fnr × fpr × for × fdr \times \times \times threat score (ts), critical success index (csi), jaccard index = tp/tp + fn + fp a worked examplea diagnostic test with sensitivity 67% and specificity 91% is applied to 2030 people to look for a disorder with a population prevalence of 1.48% fecal occult blood screen test outcome total population(pop.) = 2030 test outcome positive test outcome negative accuracy (acc) = (tp + tn) / pop.= (20 + 1820) / 2030≈ 90.64% f1 score = 2 × precision × recall/precision + recall≈ 0.174 patients withbowel cancer(as confirmedon endoscopy) actualconditionpositive true positive (tp)= 20(2030 × 1.48% × 67%) false negative (fn)= 10(2030 × 1.48% × (100% − 67%)) true positive rate (tpr), recall, sensitivity= tp / (tp + fn)= 20 / (20 + 10)≈ 66.7% false negative rate (fnr), miss rate = fn / (tp + fn)= 10 / (20 + 10) ≈ 33.3% actualconditionnegative false positive (fp)= 180(2030 × (100% − 1.48%) × (100% − 91%)) true negative (tn)= 1820(2030 × (100% − 1.48%) × 91%) false positive rate (fpr), fall-out, probability of false alarm = fp / (fp + tn)= 180 / (180 + 1820)= 9.0% specificity, selectivity, true negative rate (tnr)= tn / (fp + tn)= 1820 / (180 + 1820)= 91% prevalence= (tp + fn) / pop.= (20 + 10) / 2030≈ 1.48% positive predictive value (ppv), precision= tp / (tp + fp)= 20 / (20 + 180)= 10% false omission rate (for)= fn / (fn + tn)= 10 / (10 + 1820)≈ 0.55% positive likelihood ratio (lr+) = tpr/fpr= (20 / 30) / (180 / 2000)≈ 7.41 negative likelihood ratio (lr−) = fnr/tnr= (10 / 30) / (1820 / 2000)≈ 0.366 false discovery rate (fdr)= fp / (tp + fp)= 180 / (20 + 180)= 90.0% negative predictive value (npv)= tn / (fn + tn)= 1820 / (10 + 1820)≈ 99.45% diagnostic odds ratio (dor) = lr+/lr−≈ 20.2 related calculations false positive rate (α) = type i error = 1 − specificity = fp / (fp + tn) = 180 / (180 + 1820) = 9% false negative rate (β) = type ii error = 1 − sensitivity = fn / (tp + fn) = 10 / (20 + 10) ≈ 33% power = sensitivity = 1 − β positive likelihood ratio = sensitivity / (1 − specificity) ≈ 0.67 / (1 − 0.91) ≈ 7.4 negative likelihood ratio = (1 − sensitivity) / specificity ≈ (1 − 0.67) / 0.91 ≈ 0.37 prevalence threshold = p t = t p r ( − t n r + 1 ) + t n r − 1 ( t p r + t n r − 1 ) +tnr-1} ≈ 0.2686 ≈ 26.9% this hypothetical screening test (fecal occult blood test) correctly identified two-thirds (66.7%) of patients with colorectal cancer. unfortunately, factoring in prevalence rates reveals that this hypothetical test has a high false positive rate, and it does not reliably identify colorectal cancer in the overall population of asymptomatic people (ppv = 10%). on the other hand, this hypothetical test demonstrates very accurate detection of cancer-free individuals (npv ≈ 99.5%). therefore, when used for routine colorectal cancer screening with asymptomatic adults, a negative result supplies important data for the patient and doctor, such as ruling out cancer as the cause of gastrointestinal symptoms or reassuring patients worried about developing colorectal cancer. estimation of errors in quoted sensitivity or specificity sensitivity and specificity values alone may be highly misleading. the 'worst-case' sensitivity or specificity must be calculated in order to avoid reliance on experiments with few results. for example, a particular test may easily show 100% sensitivity if tested against the gold standard four times, but a single additional test against the gold standard that gave a poor result would imply a sensitivity of only 80%. a common way to do this is to state the binomial proportion confidence interval, often calculated using a wilson score interval. confidence intervals for sensitivity and specificity can be calculated, giving the range of values within which the correct value lies at a given confidence level (e.g., 95%). terminology in information retrieval in information retrieval, the positive predictive value is called precision, and sensitivity is called recall. unlike the specificity vs sensitivity tradeoff, these measures are both independent of the number of true negatives, which is generally unknown and much larger than the actual numbers of relevant and retrieved documents. this assumption of very large numbers of true negatives versus positives is rare in other applications. the f-score can be used as a single measure of performance of the test for the positive class. the f-score is the harmonic mean of precision and recall: f = 2 × precision × recall precision + recall \times + in the traditional language of statistical hypothesis testing, the sensitivity of a test is called the statistical power of the test, although the word power in that context has a more general usage that is not applicable in the present context. a sensitive test will have fewer type ii errors.