Study guides · Intermediate

Understanding conditional probability through contingency tables

Use a contingency table to identify conditioning denominators, reverse a test result, and separate population changes from test performance.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Restrict the population before dividing
  2. Build all four cells
  3. Reverse the condition carefully
  4. Change the base rate
  5. Separate two notions of independence
  6. Report counts and answer a new question
  7. Ask Logeia about this articleCheck your understanding

Restrict the population before dividing

Conditional probability restricts the population before it computes a proportion. For events A and B with positive P(B), P(A given B) is P(A and B) divided by P(B). Imagine one hundred users, forty subscribers, and thirty subscribers who save a document. Among subscribers, the save rate is thirty divided by forty. Thirty divided by one hundred answers a different question: how many users both subscribe and save. Writing the denominator as a sentence is often more informative than immediately substituting numbers into a formula.

Build all four cells

Consider an invented screening dataset of one thousand items, one hundred of which are abnormal. Ninety abnormal items test positive; ninety of the nine hundred normal items also test positive. The four cells are therefore ninety, ten, ninety, and eight hundred ten. Sum both rows and columns: there are one hundred eighty positive results. Detection among abnormal items is ninety percent, whereas abnormality among positive results is fifty percent. These figures describe an arithmetic exercise, not measured performance of any deployed test or a recommendation for a real screening procedure.

Reverse the condition carefully

Reversing the condition changes the denominator even when the numerator counts the same ninety items. Bayes’ rule connects the two directions using the prior abnormality rate and the overall positive rate. The overall positive rate includes positives from both abnormal and normal items. A detection rate alone therefore cannot determine the probability of abnormality after a positive result. You also need the base rate and the false-positive behavior. Draw arrows between the corresponding table margins when reading a probability statement; the conditioning event specifies the population being selected.

Change the base rate

Keep sensitivity at ninety percent and the positive rate among normal items at ten percent, but reduce abnormality prevalence to one percent. In ten thousand items, ninety abnormal items and nine hundred ninety normal items test positive. The posterior abnormality rate is ninety over one thousand eighty, approximately eight point three percent. Conditional test rates have been held fixed in this calculation, yet the meaning of a positive changes. In practice those rates may also change across populations, so record who was sampled, how measurements were made, and which observations were missing before transporting a table.

Separate two notions of independence

Independence means that conditioning on B does not change the probability of A, whenever the condition has positive probability. Independence within each subgroup defined by C does not automatically imply independence after the groups are pooled. For example, an interface change may be unrelated to saving within subscription plans yet appear associated overall if the change is concentrated in one plan. Compare stratified tables with the pooled table. Association does not identify a causal effect, and adding conditioning variables is not a universal cure for selection bias or confounding.

Report counts and answer a new question

Report the denominator count and observation period alongside a conditional percentage. One success in two observations and five hundred in one thousand both yield fifty percent, but they do not have the same sampling uncertainty. As an exercise, reduce normal positives from ninety to forty-five while preserving all row totals. Normal negatives become eight hundred fifty-five; abnormality among positives becomes ninety over one hundred thirty-five, about two thirds. Sensitivity remains ninety percent. State which quantities are fixed before changing a cell, and check that the revised margins still describe one coherent population.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Prepare for AI systems · STEP 10

Choose a learning path