Categorical Data: Bar Charts and Pie Charts
What you'll learn: How to visually represent categorical data using bar charts, pie charts, and frequency tables to reveal patterns and proportions at a glance.
Understanding Categorical Data
Categorical data represents information that can be grouped into distinct categories or labels—like types of fruit, favorite colors, or college majors. Unlike numerical data (heights, test scores), categories don't have a natural numerical order or meaningful average. To understand this data, we visualize the frequency (count) or relative frequency (proportion) of each category.
Frequency Tables
Before visualizing, organize your data in a frequency table:
| Category | Frequency | Relative Frequency |
|---|---|---|
| Red | 15 | 0.30 |
| Blue | 25 | 0.50 |
| Green | 10 | 0.20 |
This table shows counts and the proportion each category represents of the total (50 observations).
Bar Charts
A bar chart displays categories on one axis and their frequencies on the other, using rectangular bars whose heights correspond to counts. Bars are separated by gaps, emphasizing the distinct nature of categories. Bar charts make it easy to compare frequencies across categories—you can instantly see which category is most or least common.
Think of it like a lineup of people arranged by group, where you can quickly spot which group has the most members.
Pie Charts
A pie chart divides a circle into slices, where each slice's angle (and area) represents the category's proportion of the whole. It's ideal for showing how parts contribute to a total—the entire "pie" equals 100%.
Imagine slicing a pizza where each person's slice size reflects their share of the bill.
When to Use Which
Use bar charts when comparing counts across many categories. Use pie charts when emphasizing proportions of a whole, especially with fewer categories (2–5 work best).
Key Takeaway: Bar charts and pie charts transform categorical data into intuitive visuals, making frequencies and proportions immediately clear—bar charts excel at comparison, while pie charts highlight composition.