01 / 21

Categorical Variables
with Tables

Learn how to organize, display, and interpret categorical data using frequency tables and relative frequency tables.

AP Statistics

What Is a Categorical Variable?

A categorical variable (also called a qualitative variable) places each individual into one of several groups or categories. Unlike quantitative variables, categorical variables do not have meaningful numerical operations: you cannot add or average them.

Categorical
Eye color, political party, class year, blood type, favorite genre
Quantitative
Height, GPA, temperature, income, number of siblings

Why Use Tables for Categorical Data?

Tables are the most fundamental way to summarize categorical data. They tell us how many (or what proportion) of individuals fall into each category, making patterns immediately visible.

Organize
Convert raw data into a clean, structured summary
Compare
Quickly see which categories are most or least common
Communicate
Present findings clearly to any audience

The Distribution of a Variable

The distribution of a categorical variable tells us which values (categories) the variable takes and how often it takes each one. A table is the most direct way to display a distribution.

For categorical variables, we describe the distribution by listing every category alongside either a count (frequency) or a proportion/percentage (relative frequency).

The Frequency Table

A frequency table lists each category and the count (number of observations) in that category.

Category Frequency Comedy 42 Drama 35 Action 28 Horror 15 Total 120

The Relative Frequency Table

A relative frequency table shows the proportion or percentage of observations in each category. Compute it as:

Category Rel. Freq. Percentage Comedy 0.350 35.0% Drama 0.292 29.2% Action 0.233 23.3% Horror 0.125 12.5% Total 1.000 100%

Frequency vs Relative Frequency

Frequency Table Relative Frequency Table
Shows Raw counts Proportions or percentages
Values sum to \( n \) (total observations) 1.0 (or 100%)
Best when You need exact counts You need to compare groups of different sizes
AP exam tip Verify total = \( n \) Verify total = 1.0 (allow rounding)

Rounding and the 100% Rule

When you convert frequencies to percentages, rounding can cause the total to be slightly different from exactly 100%. This is normal and expected.

Acceptable
Totals like 99.9% or 100.1% are fine due to rounding
Concerning
Totals far from 100% (e.g., 95% or 107%) signal an error or missing categories

How to Build a Frequency Table

1
Identify the variable. Confirm it is categorical: each observation falls into a distinct group.
2
List all categories. Include every possible value. Use an "Other" category only if there are many rare values.
3
Count observations. Tally how many individuals fall into each category.
4
Add a total row. Sum all frequencies. Verify that the total equals \( n \).
5
Compute relative frequencies (optional). Divide each count by \( n \). Verify the column sums to approximately 1.0.

Example 1: School Lunch Choices

A school surveyed 200 students about their lunch preference. The raw data yielded: Pizza: 72, Salad: 48, Sandwich: 52, Pasta: 28.

Lunch Choice Frequency Relative Freq. Percentage
Pizza 72 0.360 36.0%
Sandwich 52 0.260 26.0%
Salad 48 0.240 24.0%
Pasta 28 0.140 14.0%
Total 200 1.000 100%

Example 2: Comparing Two Schools

School A surveyed 200 students, and School B surveyed 500 students. Both asked about favorite subject. Why do we need relative frequencies here?

School A (\( n = 200 \)) School B (\( n = 500 \))
Math 60 (30%) 125 (25%)
English 50 (25%) 175 (35%)
Science 40 (20%) 100 (20%)
History 50 (25%) 100 (20%)

Example 3: From Raw Data to Table

A researcher records the transportation method of 20 commuters:

Transport Frequency Rel. Freq. Percent
Car 9 0.450 45.0%
Bus 5 0.250 25.0%
Train 3 0.150 15.0%
Bike 3 0.150 15.0%
Total 20 1.000 100%

Reading and Interpreting a Table

When the AP exam asks you to "describe the distribution," use these three elements:

1
Name the most common category. Which has the highest frequency or percentage?
2
Name the least common category. Which has the lowest frequency or percentage?
3
Use specific values. Always cite actual percentages or counts. "35% of students chose Comedy" is better than "most students chose Comedy."

Describing a Distribution in Context

Using the movie genre example from earlier, here is a model response:

Context
Mention the variable name and what was measured
Specifics
Use actual numbers or percentages, not vague words
Comparison
Relate categories to each other (most vs. least popular)

Common Mistakes to Avoid

✕ Missing Categories
Leaving out a category so the frequencies don't sum to \( n \). Always list every category including rare ones.
✕ Using "Skewed"
Calling a categorical distribution "skewed left" or "symmetric." These terms apply only to quantitative data.
✕ Comparing Raw Counts
Comparing frequencies across groups with different sample sizes. Use relative frequencies instead.

Summary: Key Takeaways

Concept What to Remember
Categorical variable Places individuals into groups; no meaningful arithmetic
Frequency table Lists categories + counts; total = \( n \)
Relative frequency \(\frac{\text{count}}{n}\); total = 1.0 (or 100%)
Distribution What values the variable takes and how often
Comparing groups Always use relative frequencies for different \( n \)
Describing Most/least common + specific values + context

Question 1 of 5

Which of the following is a categorical variable?

Question 2 of 5

A survey of 250 people found that 75 prefer coffee, 100 prefer tea, 50 prefer juice, and 25 prefer water. What is the relative frequency of people who prefer tea?

Question 3 of 5

A relative frequency table for a categorical variable has four categories with percentages: 28%, 34%, 22%, and 17%. What should you conclude?

Question 4 of 5

School A (\( n = 150 \)) has 60 students who walk to school. School B (\( n = 400 \)) has 120 students who walk. Which school has a higher proportion of walkers?

Question 5 of 5

Which of the following is not an appropriate way to describe the distribution of a categorical variable?