Diagnostic test (2x2 table)
Command: | Statistics ROC curves Diagnostic test (2x2 table) |
Description
This procedure creates a 2x2 table from 2 variables with dichotomous data, a test variable (the variable for which you want to obtain the test characteristics) and a classification variable (a gold standard).
On this 2x2 table test characteristics such as sensitivity, specificity, positive and negative likelihood ratio, disease prevalence as well as positive and negative predictive value, are calculated.
Required input
- Variable: select the variable of interest. his variable contains the results of the diagnostic test which for which you want to obtain the test characteristics. To obtain the 2x2 table, this variable must be a dichotomous variable coded 0 for negative test results, and 1 for positive test results.If your data are coded differently (but still dichotomous), you can use the Define status tool to recode your data.
- Classification variable: select or enter a dichotomous variable indicating diagnosis (0=negative, 1=positive).If your data are coded differently, you can use the Define status tool to recode your data.
- Filter: (optionally) a filter in order to include only a selected subgroup of cases (e.g. AGE>21, SEX="Male").
- Optionally enter Disease prevalence: if the sample sizes in the positive (Disease present) and the negative (Disease absent) groups do not reflect the real prevalence of the disease, you can enter the disease prevalence in the corresponding input box. This will have an effect on the positive and negative predictive values, and accuracy.
If your variable is continuous, you can use a logical expression to obtain the required 0 and 1 coding. For example, if you have a variable that contains the measurements for PSA, you can use the logical expression
PSA>4
as the variable. This expression will yield the value 1 (TRUE) for cases with PSA > 4, and 0 (FALSE) for cases with PSA ≤ 4.You can also use the logical function
IF(PSA>4,1,0)
which gives the same result.Results
The following statistics are reported with their 95% Confidence intervals:
- Sensitivity: probability that a test result will be positive when the disease is present (true positive rate).
- Specificity: probability that a test result will be negative when the disease is not present (true negative rate).
- AUC: Area under the ROC curve.
- Positive likelihood ratio: ratio between the probability of a positive test result given the presence of the disease and the probability of a positive test result given the absence of the disease, i.e.
$$ +LR = \frac { True\ positive\ rate } { False\ positive\ rate } = \frac { Sensitivity} { 1 - Specificity} $$
- Negative likelihood ratio: ratio between the probability of a negative test result given the presence of the disease and the probability of a negative test result given the absence of the disease, i.e.
$$ -LR = \frac { False\ negative\ rate } { True\ negative\ rate } = \frac { 1 - Sensitivity} { Specificity} $$
- Positive predictive value: probability that the disease is present when the test is positive.
$$ PPV = \frac {sensitivity \times prevalence } {sensitivity \times prevalence + (1-specificity)\times (1-prevalence) } $$
- Negative predictive value: probability that the disease is not present when the test is negative.
$$ NPV = \frac {specificity \times (1-prevalence) }{ (1-sensitivity) \times prevalence + specificity \times (1-prevalence) } $$
- Accuracy: overall probability that a patient is correctly classified.
$$ Accuracy = sensitivity \times prevalence + specificity \times (1-prevalence) $$
Sensitivity, specificity, disease prevalence, positive and negative predictive value as well as accuracy are expressed as percentages.
Confidence intervals for sensitivity, specificity and accuracy are "exact" Clopper-Pearson confidence intervals.
Confidence intervals for the likelihood ratios are calculated using the "Log method" as given on page 109 of Altman et al. 2000.
Confidence intervals for the predictive values are the standard logit confidence intervals given by Mercaldo et al. 2007; except when the predictive value is 0 or 100%, in which case a Clopper-Pearson confidence interval is reported.
Literature
- Altman DG, Machin D, Bryant TN, Gardner MJ (Eds) (2000) Statistics with confidence, 2nd ed. BMJ Books.
- Gardner IA, Greiner M (2006) Receiver-operating characteristic curves and likelihood ratios: improvements over traditional methods for the evaluation and application of veterinary clinical pathology tests. Veterinary Clinical Pathology 35:8-17.
- Griner PF, Mayewski RJ, Mushlin AI, Greenland P (1981) Selection and interpretation of diagnostic tests and procedures. Annals of Internal Medicine 94:555-600.
- Hanley JA, McNeil BJ (1982) The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology 143:29-36.
- Mercaldo ND, Lau KF, Zhou XH (2007) Confidence intervals for predictive values with an emphasis to case-control studies. Statistics in Medicine 26:2170-2183.
- Metz CE (1978) Basic principles of ROC analysis. Seminars in Nuclear Medicine 8:283-298.
- Zhou XH, NA Obuchowski, DK McClish (2002) Statistical methods in diagnostic medicine. New York: Wiley.
- Zweig MH, Campbell G (1993) Receiver-operating characteristic (ROC) plots: a fundamental evaluation tool in clinical medicine. Clinical Chemistry 39:561-577.
See also