Conditional Relative Frequency

A conditional relative frequency is a count in a two-way table divided by the total of its own row or column, not the grand total. It answers questions like “Of the seniors, what fraction sleep less than 7 hours?” Comparing conditional relative frequencies across groups shows whether two categorical variables are associated.

Before this lesson: Two-Way Tables, Categorical and Quantitative Variables and Bar Graphs and Pie Charts

Three kinds of relative frequency

A two-way table shows counts for two categorical variables at once. A school asked a random sample of 400 students how long they usually sleep on school nights. The rows are grade groups and the columns are sleep times.

Grade groupLess than 7 h7 to 8 hMore than 8 hTotal
Grades 9–10309080200
Grades 11–127010030200
Total100190110400

A relative frequency is a count divided by a total. The question you ask decides which total goes on the bottom, so there are three kinds.

  • Joint relative frequency: one cell divided by the grand total. 70 ÷ 400 = 0.175, so 17.5% of all students are in grades 11–12 and sleep less than 7 hours.
  • Marginal relative frequency: a row or column total divided by the grand total. 100 ÷ 400 = 0.25, so 25% of all students sleep less than 7 hours.
  • Conditional relative frequency: one cell divided by its own row or column total. 70 ÷ 200 = 0.35, so 35% of students in grades 11–12 sleep less than 7 hours.

Conditional relative frequency formula

\text{conditional relative frequency} = \dfrac{\text{cell count}}{\text{total of the row or column you are given}}
  • The group named after “of,” “among” or “given” sets the total. “Of the students in grades 11–12” means divide by the grades 11–12 row total.
  • A conditional distribution lists the conditional relative frequencies for every category in one row (or one column). They add to 1, or 100%.
  • Two variables are associated when the conditional distributions differ from group to group. If they are about the same, there is no association in the data.

A segmented bar graph draws each group’s conditional distribution as one bar that fills 100%. It makes the comparison easy to see.

Segmented bar graph of school-night sleep for 200 students in grades 9–10 and 200 in grades 11–12. Grades 9–10: less than 7 hours 15%, 7 to 8 hours 45%, more than 8 hours 40%. Grades 11–12: less than 7 hours 35%, 7 to 8 hours 50%, more than 8 hours 15%.
Each bar is one grade group’s conditional distribution. The bars differ, so grade group and sleep time are associated.

Conditional relative frequency examples

Examples 1–4 use the sleep table above.

Example 1: A joint relative frequency

What fraction of all 400 students are in grades 11–12 and sleep less than 7 hours?

70

Find the cell for grades 11–12 and less than 7 h.

\dfrac{70}{400} = 0.175

Divide by the grand total, because the question is about all students (see converting fractions and decimals).

0.175 = 17.5\%

Write the decimal as a percent (see percentages).

Answer: 0.175, or 17.5% of all students.

Example 2: Marginal relative frequencies

What fraction of all students sleep less than 7 hours? What fraction are in grades 9–10?

\dfrac{100}{400} = 0.25

Divide the “less than 7 h” column total by the grand total.

\dfrac{200}{400} = 0.5

Divide the grades 9–10 row total by the grand total.

Answer: 25% of students sleep less than 7 hours, and 50% are in grades 9–10.

Example 3: Conditional distributions by row

Find the conditional distribution of sleep time for each grade group.

\dfrac{30}{200} = 0.15,\ \dfrac{90}{200} = 0.45,\ \dfrac{80}{200} = 0.40

Grades 9–10: divide each cell by the row total, 200.

0.15 + 0.45 + 0.40 = 1

Check that the row adds to 1.

\dfrac{70}{200} = 0.35,\ \dfrac{100}{200} = 0.50,\ \dfrac{30}{200} = 0.15

Grades 11–12: divide each cell by the row total, 200.

0.35 + 0.50 + 0.15 = 1

Check that the row adds to 1.

Answer: grades 9–10 are 15%, 45% and 40%; grades 11–12 are 35%, 50% and 15%. The older group is more than twice as likely to sleep less than 7 hours (35% vs 15%), so grade group and sleep time are associated in this sample.

Example 4: Conditioning on a column

Of the students who sleep less than 7 hours, what fraction are in grades 11–12? Compare this with Example 3.

100

The given group is “sleeps less than 7 hours,” so use that column total.

\dfrac{70}{100} = 0.70

Divide the grades 11–12 cell by the column total.

Answer: 70% of short sleepers are in grades 11–12. That is a different question from Example 3, where 35% of students in grades 11–12 are short sleepers. Same cell, different total.

Example 5: Is there an association? (word problem)

Two schools each survey students about eating breakfast. School A: 72 yes, 48 no. School B: 108 yes, 72 no. Is there an association between school and eating breakfast in these data?

72 + 48 = 120

Find School A’s total.

\dfrac{72}{120} = 0.6

Conditional relative frequency of “yes” at School A.

108 + 72 = 180

Find School B’s total.

\dfrac{108}{180} = 0.6

Conditional relative frequency of “yes” at School B.

0.6 = 0.6

Compare the two conditional relative frequencies.

Answer: no association. Both schools have 60% yes and 40% no, even though School B has more students. Comparing counts (72 vs 108) would have been misleading.

Common mistakes

MistakeExample of the errorFix
Dividing by the grand total for a conditional question“Of grades 11–12, 70 ÷ 400 = 17.5% sleep less than 7 h.”Divide by the given group’s total: 70 ÷ 200 = 35%.
Using the wrong row or columnAnswering “of short sleepers” with 70 ÷ 200The group after “of” is the total: 70 ÷ 100 = 70%.
Comparing counts instead of proportions“School B eats more breakfast: 108 > 72.”Groups have different sizes, so compare 108 ÷ 180 with 72 ÷ 120.
Saying an association proves cause“Being older causes less sleep.”A survey shows association, not cause.
A conditional distribution that does not add to 10.35, 0.50, 0.25Recheck each division. Allow only small rounding differences.

Related methods

Conditional probability

A conditional relative frequency from data is the sample version of a conditional probability, P(A | B).

Testing an association

To decide whether an association in a sample is too big to be chance, use a chi-square test for independence (one sample) or a chi-square test for homogeneity (separate samples).

Practice problems

Problems 1–6 use this table from a random sample of 250 adults.

Age groupSummerWinterOtherTotal
Under 30602040120
30 and older503050130
Total1105090250
  1. What fraction of all adults are 30 and older and prefer winter?
  2. What fraction of all adults prefer summer?
  3. Of the adults under 30, what fraction prefer summer?
  4. Of the adults who prefer winter, what fraction are 30 and older?
  5. Find the conditional distribution of favorite season for adults 30 and older. Round to three decimal places.
  6. Is there an association between age group and favorite season in these data? Explain with conditional relative frequencies.
  7. In a club, 120 members are seniors and 80 members drive to meetings. 60 members are seniors who drive. Find the percent of seniors who drive and the percent of drivers who are seniors.
  8. In a survey of 300 people, 45% are under 18. Of those under 18, 60% play a sport. How many people under 18 play a sport?
Show answers

1.

\dfrac{30}{250} = 0.12

Divide the cell by the grand total.

Answer: 0.12, or 12%

2.

\dfrac{110}{250} = 0.44

Divide the summer column total by the grand total.

Answer: 0.44, or 44%

3.

\dfrac{60}{120} = 0.5

Divide by the under-30 row total.

Answer: 0.5, or 50%

4.

\dfrac{30}{50} = 0.6

Divide by the winter column total.

Answer: 0.6, or 60%

5.

\dfrac{50}{130} \approx 0.385

Summer: divide by the row total, 130.

\dfrac{30}{130} \approx 0.231

Winter.

\dfrac{50}{130} \approx 0.385

Other.

Answer: 0.385, 0.231 and 0.385 (they add to 1 apart from rounding)

6.

\dfrac{60}{120} = 0.5,\ \dfrac{20}{120} \approx 0.167,\ \dfrac{40}{120} \approx 0.333

Conditional distribution for under 30.

0.5 \gt 0.385

Compare the summer shares of the two age groups.

Answer: yes, there is some association. Half of the under-30 group prefers summer, compared with about 38.5% of the older group, and the older group prefers winter more often (23.1% vs 16.7%).

7.

\dfrac{60}{120} = 0.5

Of the seniors, divide by the number of seniors.

\dfrac{60}{80} = 0.75

Of the drivers, divide by the number of drivers.

Answer: 50% of seniors drive, and 75% of drivers are seniors

8.

0.45 \cdot 300 = 135

Find the number under 18 (see percent word problems).

0.6 \cdot 135 = 81

Take 60% of that group.

Answer: 81 people

Conditional relative frequency FAQ

How do you find conditional relative frequency?

Divide the cell count by the total of the row or column you are given. For “of the seniors,” divide by the seniors’ total.

What is the difference between joint, marginal and conditional relative frequency?

Joint divides one cell by the grand total. Marginal divides a row or column total by the grand total. Conditional divides one cell by its own row or column total.

How do you tell if two categorical variables are associated?

Compare the conditional distributions of one variable across the groups of the other. If they differ noticeably, the variables are associated in the data.

Do conditional relative frequencies add up to 1?

Yes, within one row (or one column) of a conditional distribution they add to 1, or 100%, apart from rounding.

Summary

  • Joint relative frequency = cell ÷ grand total.
  • Marginal relative frequency = row or column total ÷ grand total.
  • Conditional relative frequency = cell ÷ the total of the given row or column.
  • A conditional distribution adds to 1, and a segmented bar graph shows one per group.
  • Different conditional distributions across groups mean the variables are associated.

Previous lesson: Comparing Distributions

Next lesson: Correlation Coefficient

Back to the Statistics Index