impera Open Impera

AP Statistics · Exploring one-variable data

Categorical data

1Variables and data

Statistics starts with individuals (the objects described: people, animals, cars) and variables (characteristics recorded for each individual).

  • A categorical variable places each individual into a group or category: eye colour, type of phone, yes/no answers.
  • A quantitative variable takes numerical values for which arithmetic makes sense: height, income, number of siblings.

Some numbers are categorical: zip codes and jersey numbers are labels, so averaging them is meaningless.

Check yourself

Which variable is categorical?

  • Number of pets

  • Blood type

  • Height in cm

  • Reaction time

Show the answer

Blood type

Blood type puts people in groups.

2Frequency tables and relative frequency

A frequency table counts how many individuals fall in each category. A relative frequency table gives the proportion or percentage:

$$\text{relative frequency} = \frac{\text{count in category}}{\text{total}}$$

Worked example

200 students choose a favourite season: summer 84, spring 46, autumn 40, winter 30.

  1. Relative frequencies: summer $\frac{84}{200} = 0.42$, spring $0.23$, autumn $0.20$, winter $0.15$.
  2. These add to 1 (100%).

Relative frequencies let you compare groups of different sizes.

Check yourself

In a survey of 250 people, 60 prefer tea. The relative frequency is:

  • 0.24

  • 60

  • 0.6

  • 0.4

Show the answer

0.24

60 ÷ 250.

3Displaying categorical data

  • Bar chart: one bar per category, bar height = count or percentage. Bars are separated and can be in any order.
  • Pie chart: slices show parts of a whole; the categories must make up the whole and not overlap. Pie charts are harder to compare precisely than bar charts.

Watch for misleading graphs:

  • A vertical axis that does not start at zero exaggerates differences.
  • Pictographs where both the width and height of a picture are scaled make the area grow too fast.
  • 3-D effects distort sizes.

The same counts of favourite seasons: cutting the axis exaggerates the differences

Check yourself

A bar chart's vertical axis starts at 40% instead of 0%. The effect is to:

  • Change the actual percentages

  • Exaggerate differences between bars

  • Make the bars more accurate

  • Hide all differences

Show the answer

Exaggerate differences between bars

The visual ratio is distorted.

4Describing categorical data

When describing a bar chart or table, comment on:

  • The mode: the most common category.
  • How the counts or percentages compare across categories (with numbers).
  • Any categories that are unusually large or small.

You cannot describe shape or centre in the numerical sense, because categories have no natural numerical order (unless they are ordinal, like "low, medium, high").

Example

"Summer was the most popular season (42%), chosen by almost three times as many students as winter (15%)."

Check yourself

Which description is appropriate for categorical data?

  • The mean season was spring

  • The distribution is skewed right

  • Summer was the most frequent category at 42%

  • The standard deviation of seasons is 1.2

Show the answer

Summer was the most frequent category at 42%

Use counts, percentages and the mode.

5Going deeper: comparing groups fairly, and spotting misleading graphs

A categorical variable places each individual in a group (eye color, type of transport, yes or no). Its values are labels; averaging them makes no sense.

Summarizing

  • Frequency (count): how many fall in each category.
  • Relative frequency (proportion or percent): count ÷ total.
  • A frequency table or relative frequency table lists them.
Worked example

200 students were asked how they get to school: bus 84, car 60, walk 36, bike 20.

  1. Relative frequencies: 84 ÷ 200 = 42%; 60 ÷ 200 = 30%; 36 ÷ 200 = 18%; 20 ÷ 200 = 10%.
  2. Check: they total 100%.
  3. Description: the bus is the most common method (42%), followed by car (30%); cycling is least common (10%).

Graphs

  • Bar graph: one bar per category; bars do not touch; the height is the count or the percent. The order of the bars is arbitrary (unless the categories have a natural order).
  • Pie chart: only when the categories make up a whole. Hard to read precisely; bar graphs are usually better.
  • Side-by-side bar graph and segmented bar graph: for comparing the distribution of a categorical variable across groups.
  • Mosaic plot: a segmented bar graph in which the width of each bar shows the size of the group.

Describing a categorical distribution: say which categories are most and least common, with percents, in context. Words such as "center," "spread," "skewed" and "symmetric" do not apply: the categories have no numerical order.

Compare with relative frequencies when group sizes differ.

Worked example

120 of 300 ninth-graders and 90 of 180 twelfth-graders have a part-time job.

  1. Counts suggest more ninth-graders have jobs (120 against 90).
  2. Proportions: 120 ÷ 300 = 40%; 90 ÷ 180 = 50%.
  3. A greater proportion of twelfth-graders have jobs. The counts mislead because the groups differ in size.

Misleading graphs: what to look for.

  • A vertical axis that does not start at zero: small differences look large. In a bar graph the eye compares lengths, so the bars must start at zero.
  • Pictographs whose pictures grow in both width and height: doubling the height quadruples the area, exaggerating the difference.
  • Unequal bar widths.
  • Missing labels or scales; unclear whether counts or percents are shown.
  • Three-dimensional effects that distort sizes.
  • Categories that overlap or do not cover everyone.

Worked example (a misleading bar graph): two brands have satisfaction ratings of 84% and 88%, drawn with the vertical axis running from 82% to 90%.

  1. The bars have heights of 2 units and 6 units on the page.
  2. Brand B's bar looks three times as tall, though its rating is only 4 percentage points higher.
  3. Redrawn from zero, the bars are nearly equal.

Percent, percentage points and "times as many": a rise from 40% to 50% is 10 percentage points, and a 25% relative increase. Say which you mean.

Counts or percents? Counts answer "how many"; percents answer "what share." A report that "crime rose by 50 incidents" means little without the starting number or the population.

Roundoff error: percents rounded to whole numbers may total 99% or 101%. That is not a mistake.

From categorical to quantitative, and back: a quantitative variable can be turned into a categorical one by grouping (ages into "under 18," "18 to 64," "65 and over"), but not the reverse. Some numbers are really categories: postal codes, jersey numbers.

Common mistakes

  • Describing a bar graph's "shape" as skewed.
  • Comparing counts between groups of different sizes.
  • Using a pie chart when the categories are not parts of one whole (for instance, when people could choose more than one answer).
  • Confusing a bar graph (categories; gaps between bars) with a histogram (numbers; bars touch).
  • Forgetting context: "42%" of what?
Check yourself

Two schools report the number of students who play an instrument: 150 at School A and 120 at School B. What else is needed to compare the schools fairly?

  • The names of the instruments

  • The standard deviation of the counts

  • The total number of students at each school

  • The median age of the students

Show the answer

The total number of students at each school

Proportions, not counts, allow comparison between groups of different sizes.

6For top marks

  • Name the variable type before choosing a display.
  • Use relative frequencies when comparing groups of unequal size.
  • Spot misleading features: non-zero baselines, area distortion, 3-D effects, missing labels.
  • Always describe in context, with numbers.
Example

"Because the school surveys had 400 and 150 students, comparing raw counts would be misleading; 30% versus 40% shows the second school has the larger proportion."

Check yourself

Two schools have 500 and 200 students. To compare the proportion who walk to school, you should use:

  • Relative frequencies

  • The mean

  • Raw counts

  • The range

Show the answer

Relative frequencies

Different group sizes.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera