APrep Open the app

AP Statistics · Unit 1: Exploring & Collecting Data

1.4 Representing a Categorical Variable with Graphs

Graphing categorical data

Categorical variables are best shown with bar graphs or pie charts. Bar graphs display each category's count or percent as a separate bar, with gaps between bars to show categories aren't connected. Pie charts show each category as a slice of the whole, useful for showing parts of a total (100%).

Bar graphs vs. pie charts

Bar graphs are easier to compare across many categories and can show either frequencies (counts) or relative frequencies (percents). Pie charts work best with few categories and emphasize how each piece contributes to the whole. Bars should never be ordered by height unless the variable has a natural order — otherwise arrange alphabetically or by category order given.

Reading and critiquing graphs

Watch for misleading graphs: unequal bar widths, truncated axes, or 3D effects that distort visual comparisons. A good graph starts its vertical axis at zero and labels both axes clearly. When comparing two categorical variables, a segmented bar graph or mosaic plot can show relative frequencies within each group.

Key terms

Bar graph
A graph using separate bars (with gaps) to show the frequency or relative frequency of each category.
Pie chart
A circular graph divided into slices, each representing a category's proportion of the whole (100%).
Segmented bar graph
A bar graph divided into segments showing the relative frequencies of a second categorical variable within each category.
Misleading graph feature
Truncated axes, unequal bar widths, or 3D effects that distort comparisons between categories.
Relative frequency
The proportion (percent) of observations in a category, calculated as count in category ÷ total count.

Try an AP-style question

Which graph is best for comparing the conditional distribution of a categorical variable across groups?

  1. A dotplot for each group
  2. A histogram of the counts
  3. A scatterplot of the two variables
  4. A segmented (stacked) bar chart
Show the answer

D. Each bar shows 100% of one group.

Practice 8 AP-style questions with instant explanations, flashcards and spaced review.

Study 1.4 free in APrep