# //fpnotebook.com/

## Contingency Table

*Aka: Contingency Table, Contingency Grid, Cross Tabulation, Cross Tab, Statistics Example*

- See Also
- Screening Test
- Bayes Theorem (Bayesian Statistics)
- Fagan Nomogram
- Experimental Error (Experimental Bias)
- Lead-Time Bias
- Length Bias
- Selection Bias
- Likelihood Ratio (Positive Likelihood Ratio, Negative Likelihood Ratio)
- Number Needed to Screen (Number Needed to Treat, Absolute Risk Reduction, Relative Risk Reduction)
- Negative Predictive Value
- Positive Predictive Value
- Pre-Test Odds or Post-Test Odds
- Receiver Operating Characteristic
- Test Sensitivity (False Negative Rate)
- Test Specificity (False Positive Rate)
- U.S. Preventive Services Task Force Recommendations

- Technique: Setting up grid for test efficacy or risk factor
- Examples
- Test efficacy: How well does a test detect a certain condition
- Risk Factor: How much is a particular risk associated with a given condition

- Draw 2x2 grid
- Labels
- Upper Boxes: Across the top (x-axis) place the Disease State Labels
- Left Box: Disease present (e.g. Breast Cancer)
- Right Box: Disease not present (e.g. Not Breast Cancer)

- Left Boxes: Across the left (y-axis) place the Test Result Labels
- Upper Box: Test Positive, Screened or exposed to contributing factor
- Lower Box: Test Negative, Not screened, no exposed

- Upper Boxes: Across the top (x-axis) place the Disease State Labels

- Examples
- Example: Breast Cancer Screening with Mammogram
- Given
- Risk of Breast Cancer based on age
- Age 40 years old: 1 in 69
- Age 50 years old: 1 in 42
- Age 60 years old: 1 in 29

- Mammogram efficacy
- Note: We use the upper end of the Test Sensitivity and Specificity ranges for this example
- Test Sensitivity: 77-95%
- Test Specificity: 94-97%

- Risk of Breast Cancer based on age
- Create a hypothetical grid for patients age 40 who undergo Mammograms
- Generating example data
- Of 100,000 patients, 1449 will have Breast Cancer (1 in 69)
- Of the 1449 with Breast Cancer, 1376 will be detected with Mammogram (95% Test Sensitivity)
- Of the 98,551 without Breast Cancer, 95,594 will have a normal Mammogram (97% Specificity)

- Label the grid top
- Disease Positive (or D+): Breast Cancer positive
- Disease Negative (or D-): Breast Cancer negative

- Label the grid left
- Fill in total patients first (bottom row)
- Breast Cancer positive (D+): 1449
- Every 69 in 100,000 will have Breast Cancer for those at age 40

- Breast Cancer negative (D-): 98,551
- The remainder of the 100,000 without Breast Cancer

- Breast Cancer positive (D+): 1449
- Complete the left column (D+)
- Top left: Mammogram Positive (or T+): 1376
- True positive patients represent 95% of 1449 (the Test Sensitivity)

- Bottom left: Mammogram Negative (or T-): 73
- False negative patients represents 1449 - 1376

- Top left: Mammogram Positive (or T+): 1376
- Complete the right column (D-)
- Bottom right: Mammogram Negative (or T-): 95,594
- True negative patients represents 97% of 98,551 (the Test Specificity)

- Top right: Mammogram Positive (or T+): 2957
- False positive patients represents 98,551 - 95,594

- Bottom right: Mammogram Negative (or T-): 95,594

- Generating example data
- Summary of grid
- D+ T+: 1376 (true positives)
- D- T+: 2957 (false positives)
- D+ T- : 73 (false negatives)
- D- T- : 95,594 (true negatives)

- Calculations
- Test Sensitivity
- Sensitivity: True positives / (true positives + false negatives)
- Sensitivity: 1376 / (1376 + 73) = 95%

- Test Specificity
- Specificity: True negatives / (true negatives + false positives)
- Specificity: 95,594 / (95,594 + 2957) = 97%

- Positive Predictive Value (PPV)
- PPV: True positive / (true positives + false positives)
- PPV: 1376 / (1376 + 2957) = 32%

- Negative Predictive Value (NPV)
- NPV: True negative / (true negative + false negatives)
- NPV: 95,594 / (95,594 + 73) = 99%

- False Positive Rate (type I error or a)
- a: (1 - Test Specificity)
- a: (1 - 0.97) = 3%

- False Negative Rate (type II error or b)
- b: (1 - Test Sensitivity)
- b: (1 - 0.95) = 5%

- Likelihood Ratio positive (LR+)
- LR+: Sensitivity / (1-Specificity)
- LR+: 0.95 / (1 - 0.97) = 32 (high likelihood of disease if >10)

- Likelihood Ratio negative (LR-)
- LR-: (1 - Sensitivity) / (Specificity)
- LR-: (1 - 0.95) / 0.97 = 0.05 (low likelihood of disease if <0.1)

- Test Sensitivity

- Given