A constructed table sorts 80 items by two features, whether an item is tagged and whether it is a priority item, and one item is drawn with all 80 equally likely. The 18 items that are both tagged and priority can be measured against all 80 items, against the 30 tagged items or against the 28 priority items, and each choice answers a different question. This lesson shows how to read joint, marginal and conditional probabilities from one table and how to tell which total belongs in the denominator.
Key terms
Two-way table
Definition A two-way table classifies every member of a finite collection by two features at once. The categories of the first feature label the rows and those of the second label the columns. Within each feature the categories do not overlap and together cover the whole collection, so every member lies in exactly one interior cell. Each cell counts the members in one row category and one column category. The row totals, the column totals and the cells each add to the grand total. A table can record counts or probabilities, and when one member is drawn uniformly at random, every probability read from a table of counts is one count divided by another.
In plain words A two-way table is a grid in which each member of the collection lands in exactly one box. Its edges hold the totals that later serve as denominators.
Example Let be the event that the drawn item is tagged and the event that it is a priority item, with for high priority. The constructed table is
| Item | Priority | Standard | Total |
|---|---|---|---|
| Tagged | 18 | 12 | 30 |
| Untagged | 10 | 40 | 50 |
| Total | 28 | 52 | 80 |
The row totals and the column totals both give the grand total , a quick check that the cells and the margins agree. A missing cell can be recovered from a total by subtraction, and no cell can exceed its row total or its column total.
Joint probability
Definition The joint probability of events and is , the probability that both occur. In a table of counts with one member drawn uniformly, the joint probability of a row category and a column category is the count in their cell divided by the grand total. The cell events are disjoint and together make up the whole sample space, so their joint probabilities are nonnegative and add to .
In plain words A joint probability measures one box against the whole collection.
Example The cell of tagged priority items gives
Dividing every cell and every total by gives the table of joint probabilities, whose four interior entries add to .
| Item | Total | ||
|---|---|---|---|
| 0.225 | 0.15 | 0.375 | |
| 0.125 | 0.5 | 0.625 | |
| Total | 0.35 | 0.65 | 1 |
The count 18 and the joint probability 0.225 describe the same cell in different units.
Marginal probability
Definition The margins of a two-way table are its row totals and column totals, written along its edges. The marginal probability of a row category is its row total divided by the grand total, and likewise for a column category. Equivalently, it is the sum of the joint probabilities across that row or down that column. For the tagged row,
because and are disjoint events whose union is . This step uses only additivity and needs no assumption about how the two features are related.
In plain words A marginal probability ignores one feature by adding over all of its categories.
Example The margins of the count table give
The table of joint probabilities shows the same values as sums, along the tagged row and down the priority column.
Row and column percentages
Definition Row percentages divide each cell of a row by that row’s total. For the cell in the row of an event and the column of an event , the result is , so the row percentages within each row add to 100 percent. Column percentages divide each cell of a column by that column’s total, which gives , and the column percentages within each column add to 100 percent. Either kind needs a positive total in the row or column used. For one cell, the row percentage and the column percentage share the numerator and differ in the denominator.
In plain words Every percentage needs an answer to the question “percent of what?” The row or column you divide by is the reference group, and the two directions answer different questions.
Example Among the 30 tagged items 18 are priority, and among the 28 priority items 18 are tagged. So
The full row percentages split the tagged row into 60 percent priority and 40 percent standard, and the untagged row into 20 percent and 80 percent. The column percentages split the priority column into about 64.3 percent tagged and 35.7 percent untagged. Adding the row figure of 60 percent to the column figure of 64.3 percent would mean nothing, since they are shares of different groups. Keep exact fractions while calculating and round only the reported value.
Natural frequencies
Definition A natural frequency states a conditional probability as a count out of a stated group size, such as 18 of the 30 tagged items, with all the groups taken from one collection of known size. For disjoint groups, both the counts and the group sizes can then be added. When the groups make up the whole collection, the overall share of a category is the total count over the total size, which equals the average of the within-group rates weighted by the group sizes.
In plain words Keep the counts, not only the percentages. A rate that comes with its group size can be combined with other rates correctly, while percentages from groups of unknown size in general cannot.
Example Priority items make up 18 of the 30 tagged items and 10 of the 50 untagged items, so
The plain average is wrong for this table, because the lower rate belongs to the larger group. Now keep the rates and change the group sizes. A second constructed table of 80 items has 20 tagged items, 12 of them priority, and 60 untagged items, 12 of them priority.
| Item | Priority | Standard | Total |
|---|---|---|---|
| Tagged | 12 | 8 | 20 |
| Untagged | 12 | 48 | 60 |
| Total | 24 | 56 | 80 |
The within-group rates are still and , yet now and , compared with and before. Changing the group sizes moved both the overall probability and the reversed conditional probability.
Check yourself
- A constructed collection has 60 packages. Of these, 20 are fragile, 30 are large and 12 are both fragile and large. Complete the two-way table with the rows fragile and ordinary and the columns large and small.
Show the answer
The fragile row has 20 packages, so are fragile and small. The large column has 30 packages, so are ordinary and large. The last cell is .
| Package | Large | Small | Total |
|---|---|---|---|
| Fragile | 12 | 8 | 20 |
| Ordinary | 18 | 22 | 40 |
| Total | 30 | 30 | 60 |
The row totals and the column totals both add to 60.
- One package is drawn uniformly at random from the table in question 1. Find , , and the joint probability , naming each denominator first.
Show the answer
Given large, the reference group is the 30 large packages, so . Given fragile, it is the 20 fragile packages, so . Given small, it is the 30 small packages, 8 of them fragile, so . The joint probability is measured against all 60 packages, so . The same cell of 12 gives three different answers through three different denominators.
- A colleague claims that is always the plain average of and . Test the claim on the package table, then test the matching claim for on the first 80-item table. What decides whether the plain average works?
Show the answer
For the packages the plain average is
and , so the claim holds here. For the first 80-item table the plain average of and is , but , so the claim fails.
The overall rate is the average of the group rates weighted by the group sizes. The large and small groups both have 30 packages, so their weights are equal, while the tagged and untagged groups have 30 and 50 items. With two nonempty groups, the plain average is correct exactly when the groups have equal size or the two group rates are equal.