Two-way frequency table: A table that displays the frequency of data points for 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 across the other variable.
- Identify the two categorical variables
- Create rows for one variable and columns for the other
- Fill in the joint frequencies
- Calculate row totals and column totals
- Verify that grand total matches sample size
Variable 1: Grade level (Freshman, Sophomore)
Variable 2: Favorite subject (Math, English)
| Favorite Subject | Math | English | Total |
|---|---|---|---|
| Freshman | 60 | 40 | 100 |
| Sophomore | 70 | 30 | 100 |
| Total | 130 | 70 | 200 |
Freshmen who prefer Math: 60 (joint frequency)
Freshmen who prefer English: 40 (joint frequency)
Sophomores who prefer Math: 70 (joint frequency)
Sophomores who prefer English: 30 (joint frequency)
Row marginals (grade totals):
• Freshmen total: 60 + 40 = 100
• Sophomores total: 70 + 30 = 100
Column marginals (subject totals):
• Math total: 60 + 70 = 130
• English total: 40 + 30 = 70
Sum of all joint frequencies: 60 + 40 + 70 + 30 = 200
Grand total from row/column: 100 + 100 = 200 or 130 + 70 = 200
✓ Verification confirms table is correct
The two-way table shows joint frequencies of student preferences by grade level. Marginal frequencies show that there are 100 freshmen and 100 sophomores, with 130 preferring Math and 70 preferring English. The most popular combination is Sophomore + Math (70 students).
• Joint frequencies: Internal cells of the table
• Marginal frequencies: Row and column totals
• Grand total: Sum of all joint frequencies
Conditional frequency: The frequency of one variable given that another variable takes a specific value.
Conditional relative frequency: The conditional frequency divided by the relevant marginal total.
| Favorite Subject | Math | English | Total |
|---|---|---|---|
| Freshman | 60 | 40 | 100 |
| Sophomore | 70 | 30 | 100 |
| Total | 130 | 70 | 200 |
Formula: P(A|B) = P(A and B) ÷ P(B)
In terms of frequencies: P(Math | Sophomore) = Joint frequency (Sophomore and Math) ÷ Marginal frequency (Sophomore)
P(Math | Sophomore) = 70 ÷ 100 = 0.70 or 70%
P(Sophomore | English) = Joint frequency (Sophomore and English) ÷ Marginal frequency (English)
P(Sophomore | English) = 30 ÷ 70 = 0.429 or 42.9%
Given a student is a Sophomore, there's a 70% chance they prefer Math
Given a student prefers English, there's a 42.9% chance they are a Sophomore
Unconditional P(Math) = 130/200 = 0.65
Conditional P(Math | Sophomore) = 0.70
Sophomores are more likely to prefer Math than the general population
The conditional probability of preferring Math given Sophomore status is 70%. The conditional probability of being a Sophomore given English preference is 42.9%. This shows that Sophomores are more likely to prefer Math than the general student population (65% vs 70%).
• Conditional probability: P(A|B) = P(A ∩ B) ÷ P(B)
• Frequency version: Joint frequency ÷ Relevant marginal frequency
• Interpretation: Probability within a specific subgroup
Independence: Two variables are independent if knowing the value of one variable provides no information about the value of the other variable.
Association: Two variables are associated if there's a relationship between their values.
Variables are independent if: P(A|B) = P(A) for all combinations
Or equivalently: P(A and B) = P(A) × P(B)
P(Math) = 130/200 = 0.65
P(English) = 70/200 = 0.35
P(Freshman) = 100/200 = 0.50
P(Sophomore) = 100/200 = 0.50
P(Math | Freshman) = 60/100 = 0.60
P(Math | Sophomore) = 70/100 = 0.70
P(English | Freshman) = 40/100 = 0.40
P(English | Sophomore) = 30/100 = 0.30
If independent, P(Math | Freshman) should equal P(Math) = 0.65
Actual: P(Math | Freshman) = 0.60 ≠ 0.65
If independent, P(Math | Sophomore) should equal P(Math) = 0.65
Actual: P(Math | Sophomore) = 0.70 ≠ 0.65
If independent: P(Freshman and Math) = P(Freshman) × P(Math)
Expected: 0.50 × 0.65 = 0.325
Actual: 60/200 = 0.30 ≠ 0.325
Since conditional probabilities differ from unconditional probabilities, and joint probabilities don't match expected values under independence, the variables are associated.
Sophomores are more likely to prefer Math than Freshmen.
Grade level and favorite subject are not independent. There is an association: Sophomores are more likely to prefer Math (70%) than Freshmen (60%). The probability of preferring Math changes based on grade level, indicating dependence between the variables.
• Independence test: P(A|B) = P(A) for all combinations
• Joint probability: P(A and B) = P(A) × P(B) under independence
• Association evidence: Differences in conditional probabilities
P(A \cap B)
P(A) or P(B)
Contingency table: A two-way table showing the frequency distribution of two categorical variables.
Relative frequencies: Proportions calculated as frequency ÷ total observations.
Independence: Two variables are independent if the occurrence of one doesn't affect the probability of the other.
- Construct table: Fill in joint frequencies
- Calculate marginals: Row and column totals
- Compute relative frequencies: Joint, marginal, and conditional
- Test independence: Compare conditional to marginal probabilities
- Interpret associations: Identify patterns in the data
• Positive association: Higher conditional probability than marginal probability
• Negative association: Lower conditional probability than marginal probability
• Independence: Conditional probability equals marginal probability
Relative frequency: The proportion of observations in each category, calculated as frequency ÷ total observations.
Joint relative frequency: Proportion in a specific cell of the table.
Marginal relative frequency: Proportion for a row or column total.
| Favorite Subject | Math | English | Total |
|---|---|---|---|
| Freshman | 60 | 40 | 100 |
| Sophomore | 70 | 30 | 100 |
| Total | 130 | 70 | 200 |
| Favorite Subject | Math | English | Total |
|---|---|---|---|
| Freshman | 0.30 | 0.20 | 0.50 |
| Sophomore | 0.35 | 0.15 | 0.50 |
| Total | 0.65 | 0.35 | 1.00 |
Given Grade Level (row conditional):
P(Math | Freshman) = 60/100 = 0.60
P(English | Freshman) = 40/100 = 0.40
P(Math | Sophomore) = 70/100 = 0.70
P(English | Sophomore) = 30/100 = 0.30
Given Subject (column conditional):
P(Freshman | Math) = 60/130 = 0.462
P(Sophomore | Math) = 70/130 = 0.538
P(Freshman | English) = 40/70 = 0.571
P(Sophomore | English) = 30/70 = 0.429
Joint relative frequencies show the overall distribution of combinations
Row conditional frequencies reveal grade-level preferences
Column conditional frequencies reveal subject-level grade composition
The relative frequency table shows that 35% of students are Sophomores who prefer Math, which is the largest single group. Conditional analysis reveals that Sophomores are more likely to prefer Math (70%) than Freshmen (60%), indicating an association between grade level and subject preference.
• Joint relative frequency: Cell value ÷ Grand total
• Conditional frequency: Cell value ÷ Relevant marginal total
• Sum property: Marginal relative frequencies sum to 1
Contingency analysis: Examining the relationship between two categorical variables.
Segmentation: Dividing populations into meaningful groups for analysis.
| News Source | TV | Online | Total | |
|---|---|---|---|---|
| Young Adult | 40 | 110 | 10 | 160 |
| Middle Age | 60 | 90 | 40 | 190 |
| Senior | 80 | 30 | 40 | 150 |
| Total | 180 | 230 | 90 | 500 |
Young Adults:
P(TV | YA) = 40/160 = 0.25, P(Online | YA) = 110/160 = 0.688, P(Print | YA) = 10/160 = 0.063
Middle Age:
P(TV | MA) = 60/190 = 0.316, P(Online | MA) = 90/190 = 0.474, P(Print | MA) = 40/190 = 0.211
Seniors:
P(TV | S) = 80/150 = 0.533, P(Online | S) = 30/150 = 0.200, P(Print | S) = 40/150 = 0.267
P(TV) = 180/500 = 0.36, P(Online) = 230/500 = 0.46, P(Print) = 90/500 = 0.18
Young Adults strongly prefer online (68.8% vs 46% overall)
Seniors strongly prefer TV (53.3% vs 36% overall)
Middle Age shows more balanced preferences
There is a clear association between age and news preference
Young adults favor online sources
Seniors favor traditional sources (TV and print)
Middle age group is more diverse in preferences
There is a strong association between age and news source preference. Young adults overwhelmingly prefer online sources (68.8%), while seniors prefer traditional sources (TV: 53.3%, Print: 26.7%). Middle age adults show more balanced preferences. This demonstrates how demographic factors influence media consumption habits.
• Association detection: Compare conditional to marginal probabilities
• Pattern identification: Look for significant differences in conditional distributions
• Real-world interpretation: Connect statistical findings to practical implications
Two-way table: A contingency table displaying 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 a variable, found in row or column totals.
Conditional frequency: The frequency of one variable given a specific value of the other variable.
Independence: Two variables are independent if the occurrence of one doesn't affect the probability of the other.
- Table construction: Organize data into rows and columns
- Frequency calculation: Fill in joint, marginal, and conditional frequencies
- Association testing: Compare conditional to marginal probabilities
- Pattern interpretation: Identify meaningful relationships
- Conclusion drawing: State findings in context
• Joint = Marginal × Conditional: P(A ∩ B) = P(A) × P(B|A)
• Independence: P(A|B) = P(A), P(B|A) = P(B)
• Association: Conditional probabilities differ from marginal probabilities
• Sum property: Conditional probabilities in each row/column sum to 1
Joint frequencies: Count of observations in specific cells
Marginal frequencies: Totals for rows and columns
Conditional frequencies: Probabilities within specific groups
Independence: No association between variables
Association: Relationship between categorical variables
Analysis: Contingency tables reveal relationships between categorical variables through frequency patterns.
- 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