Two-way table: A table that displays the frequency distribution of two categorical variables.
Joint frequency: The count of observations that fall into a specific combination of categories.
Marginal frequency: The total count for each category of one variable across all categories of the other variable.
Conditional frequency: The frequency of one variable given that another variable takes a specific value.
- Fill in the complete table with row and column totals
- Identify all joint frequencies (internal cells)
- Calculate marginal frequencies (row and column totals)
- Compute conditional frequencies by dividing by relevant marginal totals
- Interpret the relationships between variables
| Genre | Action | Romance | Comedy | Total |
|---|---|---|---|---|
| Men | 45 | 15 | 30 | 90 |
| Women | 20 | 50 | 30 | 100 |
| Total | 65 | 65 | 60 | 190 |
These are the internal cells of the table:
Men and Action: 45
Men and Romance: 15
Men and Comedy: 30
Women and Action: 20
Women and Romance: 50
Women and Comedy: 30
Row totals (gender margins):
Men total: 90
Women total: 100
Column totals (genre margins):
Action total: 65
Romance total: 65
Comedy total: 60
For Men:
P(Action | Men) = 45/90 = 0.50 or 50%
P(Romance | Men) = 15/90 = 0.167 or 16.7%
P(Comedy | Men) = 30/90 = 0.333 or 33.3%
For Women:
P(Action | Women) = 20/100 = 0.20 or 20%
P(Romance | Women) = 50/100 = 0.50 or 50%
P(Comedy | Women) = 30/100 = 0.30 or 30%
For Action:
P(Men | Action) = 45/65 = 0.692 or 69.2%
P(Women | Action) = 20/65 = 0.308 or 30.8%
For Romance:
P(Men | Romance) = 15/65 = 0.231 or 23.1%
P(Women | Romance) = 50/65 = 0.769 or 76.9%
The analysis shows clear gender preferences: Men prefer Action (50%) while Women prefer Romance (50%). Comedy is popular among both groups (33.3% for Men, 30% for Women). The most popular combination is Men choosing Action (45 out of 190 total responses).
• Joint frequencies: Values in internal cells of table
• Marginal frequencies: Row and column totals
• Conditional frequencies: Cell value ÷ Relevant marginal total
Conditional probability: The probability of an event occurring given that another event has occurred.
Notation: P(A|B) means "probability of A given B."
| Genre | Action | Romance | Comedy | Total |
|---|---|---|---|---|
| Men | 45 | 15 | 30 | 90 |
| Women | 20 | 50 | 30 | 100 |
| Total | 65 | 65 | 60 | 190 |
This is the probability of choosing Action given that the person is a Man
Formula: P(Action | Man) = P(Action and Man) ÷ P(Man)
Using frequencies: P(Action | Man) = 45 ÷ 90 = 0.50 or 50%
This is the probability of being a Man given that the person chose Action
Formula: P(Man | Action) = P(Man and Action) ÷ P(Action)
Using frequencies: P(Man | Action) = 45 ÷ 65 = 0.692 or 69.2%
This asks: "Of all Men, what percentage prefer Action?"
Answer: 50% of Men prefer Action movies
This asks: "Of all Action movie fans, what percentage are Men?"
Answer: 69.2% of Action movie fans are Men
The denominators are different:
P(Action | Man): Denominator is total Men (90)
P(Man | Action): Denominator is total Action fans (65)
They answer different questions about the relationship between gender and preference
P(Action | Man) = 0.50 means 50% of Men prefer Action movies. P(Man | Action) = 0.692 means 69.2% of Action movie fans are Men. These probabilities are different because they have different reference groups: the first considers all Men, the second considers all Action fans. This illustrates that P(A|B) ≠ P(B|A) in general.
• Conditional probability: P(A|B) = P(A ∩ B) ÷ P(B)
• Order matters: P(A|B) ≠ P(B|A) unless P(A) = P(B)
• Reference group: The condition determines the denominator
Independence: Two variables are independent if the occurrence of one does not affect the probability of the other.
Association: A relationship between two variables where the probability of one depends on the value of the other.
Variables are independent if: P(A|B) = P(A) for all combinations
Or equivalently: P(A and B) = P(A) × P(B)
P(Men) = 90/190 = 0.474
P(Women) = 100/190 = 0.526
P(Action) = 65/190 = 0.342
P(Romance) = 65/190 = 0.342
P(Comedy) = 60/190 = 0.316
P(Action | Men) = 45/90 = 0.500
P(Action | Women) = 20/100 = 0.200
P(Romance | Men) = 15/90 = 0.167
P(Romance | Women) = 50/100 = 0.500
Is P(Action | Men) = P(Action)? 0.500 ≠ 0.342 → No
Is P(Action | Women) = P(Action)? 0.200 ≠ 0.342 → No
Is P(Romance | Men) = P(Romance)? 0.167 ≠ 0.342 → No
Is P(Romance | Women) = P(Romance)? 0.500 ≠ 0.342 → No
If independent: P(Action and Men) = P(Action) × P(Men)
Expected: 0.342 × 0.474 = 0.162
Actual: 45/190 = 0.237 ≠ 0.162
Since conditional probabilities differ significantly from marginal probabilities, the variables are dependent.
Gender affects movie preference and vice versa.
Gender and movie preference are not independent. There is a strong association: Men are more likely to prefer Action (50% vs 34.2% overall) and less likely to prefer Romance (16.7% vs 34.2% overall). Women show the opposite pattern. The conditional probabilities differ significantly from marginal probabilities, confirming dependence.
• Independence test: P(A|B) = P(A) for all combinations
• Joint probability test: P(A ∩ B) = P(A) × P(B)
• Association indicator: Large differences between conditional and marginal probabilities
Cell values
Row/col totals
Relative to condition
Contingency table: A table showing the frequency distribution of two categorical variables.
Relative frequencies: Proportions calculated as frequency ÷ total observations.
Independence: Two variables are independent if knowing the value of one doesn't change the probability of the other.
- Identify variables: Determine what each row and column represents
- Calculate joint frequencies: Count observations in each cell
- Calculate marginal frequencies: Sum rows and columns
- Compute conditional frequencies: Divide cells by relevant margins
- Test independence: Compare conditional to marginal probabilities
- Draw conclusions: Interpret findings in context
• Positive association: Conditional probability higher than marginal probability
• Negative association: Conditional probability lower than marginal probability
• Independence: Conditional probability equals marginal probability
Relative frequency table: A table showing proportions or percentages instead of raw counts.
Proportional analysis: Examining relationships between variables using ratios rather than counts.
| Genre | Action | Romance | Comedy | Total |
|---|---|---|---|---|
| Men | 45 | 15 | 30 | 90 |
| Women | 20 | 50 | 30 | 100 |
| Total | 65 | 65 | 60 | 190 |
| Genre | Action | Romance | Comedy | Total |
|---|---|---|---|---|
| Men | 0.237 | 0.079 | 0.158 | 0.474 |
| Women | 0.105 | 0.263 | 0.158 | 0.526 |
| Total | 0.342 | 0.342 | 0.316 | 1.000 |
For Men (divide each cell in Men row by 0.474):
P(Action | Men) = 0.237 ÷ 0.474 = 0.500
P(Romance | Men) = 0.079 ÷ 0.474 = 0.167
P(Comedy | Men) = 0.158 ÷ 0.474 = 0.333
For Action (divide each cell in Action column by 0.342):
P(Men | Action) = 0.237 ÷ 0.342 = 0.693
P(Women | Action) = 0.105 ÷ 0.342 = 0.307
Relative frequencies normalize for different group sizes, making comparisons clearer
They reveal the proportional makeup of each group more clearly than raw counts
Patterns of association become more apparent when sample sizes differ
The relative frequency table shows that 50% of Men prefer Action movies, while only 20% of Women do. Similarly, 50% of Women prefer Romance, while only 16.7% of Men do. This proportional view makes the gender differences much clearer than the raw counts. The relative frequencies also sum to 1.000, confirming they represent a complete probability distribution.
• Joint relative frequency: Cell value ÷ Grand total
• Conditional relative frequency: Cell value ÷ Relevant marginal total
• Sum property: Marginal relative frequencies sum to 1
Business analytics: Using statistical methods to analyze business data and inform decisions.
Market segmentation: Dividing customers into groups based on shared characteristics.
| Meal | Breakfast | Lunch | Dinner | Total |
|---|---|---|---|---|
| Under 30 | 25 | 45 | 30 | 100 |
| 30-50 | 40 | 35 | 45 | 120 |
| Over 50 | 55 | 20 | 35 | 110 |
| Total | 120 | 100 | 110 | 330 |
Under 30: P(Breakfast) = 25/100 = 0.25, P(Lunch) = 45/100 = 0.45, P(Dinner) = 30/100 = 0.30
30-50: P(Breakfast) = 40/120 = 0.333, P(Lunch) = 35/120 = 0.292, P(Dinner) = 45/120 = 0.375
Over 50: P(Breakfast) = 55/110 = 0.50, P(Lunch) = 20/110 = 0.182, P(Dinner) = 35/110 = 0.318
P(Breakfast) = 120/330 = 0.364
P(Lunch) = 100/330 = 0.303
P(Dinner) = 110/330 = 0.333
Under 30: Lunch (45%) > Overall (30.3%), Breakfast (25%) < Overall (36.4%)
Over 50: Breakfast (50%) > Overall (36.4%), Lunch (18.2%) < Overall (30.3%)
This shows clear age-related preferences
Young adults (Under 30) prefer lunch most (45%)
Middle age (30-50) prefer dinner most (37.5%)
Older adults (Over 50) prefer breakfast most (50%)
There is a strong association between age and meal preference
There is a strong association between age and meal preference. Young adults (under 30) are most likely to choose lunch (45%), middle-aged adults (30-50) prefer dinner (37.5%), and older adults (over 50) prefer breakfast (50%). The conditional probabilities differ significantly from the marginal probabilities, confirming that age and meal choice are dependent variables. This information could help the restaurant tailor marketing and menu offerings to different age segments.
• Association detection: Compare conditional to marginal probabilities
• Pattern identification: Look for consistent differences across groups
• Business application: Use insights for targeted strategies
Two-way table: A table that displays the frequency distribution of two categorical variables.
Joint frequency: The count of observations that fall into a specific combination of categories.
Marginal frequency: The total count for each category of one variable across all categories of the other variable.
Conditional frequency: The frequency of one variable given that another variable takes a specific value.
Independence: Two variables are independent if the occurrence of one does not affect the probability of the other.
- Table construction: Organize data into rows and columns
- Frequency calculation: Compute joint, marginal, and conditional frequencies
- Independence testing: Compare conditional to marginal probabilities
- Pattern identification: Look for associations between variables
- Interpretation: Explain findings in real-world context
• Multiplication rule: P(A ∩ B) = P(A|B) × P(B)
• Independence condition: P(A|B) = P(A) and P(B|A) = P(B)
• Sum property: Conditional probabilities in each row/column sum to 1
• Bayes theorem: P(A|B) = P(B|A) × P(A) ÷ P(B)
Joint frequencies: Intersection of row and column categories
Marginal frequencies: Totals for individual variables
Conditional frequencies: Probabilities within specific groups
Independence: No association between variables
Association: Relationship between categorical variables
Analysis: Two-way tables reveal relationships between categorical variables through frequency patterns and conditional probabilities.
- Joint frequencies: Show specific category combinations
- Marginal frequencies: Show individual variable distributions
- Conditional frequencies: Reveal associations between variables
- Independence testing: Compare conditional to marginal probabilities
- Pattern identification: Look for meaningful relationships