AP-STATS-1.1-1.4

U1.1 Variables and Categorical Data

Master AP Stats 1.1-1.4: tell categorical from quantitative variables and build frequency, relative frequency, and two-way tables plus bar and pie charts.

What you'll do in this lesson

A voice-first session with the Crimsora tutor on U1.1 Variables and Categorical Data, then targeted practice and FRQs — with the tutor adapting to where you get stuck.

What this lesson covers

Every dataset starts with a question: what kind of variable am I looking at, and how do I display it honestly? In this lesson you learn to sort variables into categorical and quantitative, then organize categorical data using frequency tables, relative frequency tables, and two-way tables. You will also build and read bar charts and pie charts.

These skills anchor the entire course. The AP exam constantly asks you to identify variable type before choosing a graph or test, and two-way tables reappear in probability (Unit 4) and inference for categorical data. Get comfortable now, and later units feel far easier.

Categorical vs. Quantitative Variables

A variable is any characteristic that can take different values across individuals. The first decision you make in statistics is what type of variable you have, because it determines every graph and calculation that follows.

A categorical variable places each individual into a group or category. Examples include eye color, favorite sport, zip code, and grade level (freshman, sophomore, etc.). A quantitative variable takes numerical values for which arithmetic like averaging makes sense — height, test score, number of siblings, temperature.

The classic trap is a number that is really a category. A phone area code or a jersey number is stored as digits, but averaging them is meaningless, so they are categorical. Ask yourself: does it make sense to compute a mean? If not, it is categorical.
FeatureCategoricalQuantitative
ValuesLabels/groupsNumbers with meaning
SummaryCounts, proportionsMean, median, spread
DisplaysBar, pieDot, stem, histogram, box
ExampleBlood typeWeight in kg
On the exam, always name the variable type in words before choosing a display. Quantitative graphs like histograms are covered in later lessons; here we focus on categorical displays.

Frequency and Relative Frequency Tables

Once you have a categorical variable, the simplest summary is a frequency table, which lists each category and its count (its frequency). If 40 students chose favorite lunch options, the frequency table shows how many picked pizza, tacos, salad, and so on.

A relative frequency table converts each count to a proportion or percent by dividing by the total: relative frequency=category counttotal count\text{relative frequency} = \frac{\text{category count}}{\text{total count}}. Relative frequencies always sum to 11 (or 100%100\%, allowing for tiny rounding). They matter because they let you compare groups of different sizes fairly.

Suppose 12 of 40 students chose pizza. The relative frequency is 1240=0.30\frac{12}{40} = 0.30, or 30%30\%. If a second, larger class also had 30%30\% pizza fans, relative frequency reveals the similarity that raw counts would hide.

A common misconception is treating relative frequency as a count. Always label whether a value is a count or a proportion. On the AP exam, expect to be asked to compute a proportion from a table, or to explain why relative frequencies are preferred when comparing groups of unequal size. Show the fraction you divide, not just the final decimal, so a reader can follow your reasoning.

Two-Way Tables: Joint, Marginal, and Conditional

A two-way table (contingency table) organizes two categorical variables at once, with one variable in rows and one in columns. Each inner cell is a joint frequency — the count of individuals in both categories. The row and column totals are marginal frequencies.
CoffeeTeaTotal
Under 30402060
30+152540
Total5545100
Three proportions come from this table. A joint relative frequency divides a cell by the grand total: 40100=0.40\frac{40}{100}=0.40 are under-30 coffee drinkers. A marginal relative frequency divides a total by the grand total: 55100=0.55\frac{55}{100}=0.55 prefer coffee overall. A conditional relative frequency divides a cell by a row or column total, restricting to one group: among those under 30, 40600.667\frac{40}{60}\approx0.667 prefer coffee.

Conditional distributions are how you check for an association between the two variables. If the conditional distribution of drink preference differs across age groups, the variables are associated; if the conditionals are essentially identical, there is no association. The exam frequently asks you to compute a conditional proportion and then state, in context, whether an association exists. Read carefully which total the question conditions on — that choice changes the denominator and the answer.

Bar Charts and Pie Charts

Categorical data are displayed with bar charts and pie charts. A bar chart draws one bar per category, with height equal to the frequency or relative frequency; bars are separated by gaps because categories are distinct, not continuous. This gap distinguishes a bar chart from a histogram, which shows quantitative data with touching bars.

A pie chart shows each category as a slice of a circle, with slice size proportional to its relative frequency. To find a slice's angle, multiply its proportion by 360360^\circ: a 30%30\% category spans 0.30×360=1080.30 \times 360^\circ = 108^\circ.

Bar charts are usually more useful because the human eye compares bar heights more accurately than pie-slice areas, and bar charts can display counts, percentages, or side-by-side and segmented comparisons of two variables. A segmented (stacked) bar chart displays conditional distributions and is ideal for spotting association.

Watch for misleading graphs: a vertical axis that does not start at zero exaggerates differences, and reordering categories can hide patterns. On free-response questions, always label axes, include a scale, and title the graph. When asked to compare two groups, use relative frequencies so unequal group sizes do not distort the picture. Never use a pie chart for two variables at once — reach for a segmented or side-by-side bar chart instead.

Key terms

Categorical variable.
A variable that assigns each individual to a group or label, such as gender, color, or region; summarized with counts and proportions.
Quantitative variable.
A numerical variable for which arithmetic operations like averaging are meaningful, such as height, age, or score.
Relative frequency.
A category's count divided by the total number of individuals, expressed as a proportion or percent; relative frequencies sum to 1.
Two-way table.
A table displaying counts for two categorical variables simultaneously, with rows for one variable and columns for the other.
Marginal relative frequency.
A row or column total divided by the grand total, giving the distribution of a single variable ignoring the other.
Conditional relative frequency.
A cell divided by its row or column total, giving the distribution of one variable within a fixed category of the other.
Association.
A relationship in which the conditional distributions of one variable differ across categories of another variable.
Segmented bar chart.
A stacked bar chart in which each bar is divided into parts showing a conditional distribution, used to compare groups.

Worked example

A survey of 200 commuters records transportation mode (car, bus, bike) and whether the commute is over 30 minutes. Of the car users, 90 have long commutes and 30 do not. Of bus users, 25 are long and 25 are short. Of bike users, 5 are long and 20 are short. Find the marginal relative frequency of long commutes, and the conditional relative frequency of a long commute given the person bikes. Is mode associated with commute length?
First build the two-way table. Car totals 90+30=12090+30=120, bus 25+25=5025+25=50, bike 5+20=255+20=25, confirming 120+50+25=195120+50+25=195... check the grand total. The stated counts sum to 195195, but the survey says 200, so re-read: assume the given cells are complete and use 195195 as the working total (always verify totals on the exam).

Long commuters total 90+25+5=12090+25+5=120. The marginal relative frequency of long commutes is 1201950.615\frac{120}{195}\approx0.615, about 61.5%61.5\%.

For the conditional relative frequency of a long commute given biking, restrict to bike users: 525=0.20\frac{5}{25}=0.20, or 20%20\%.

Now compare conditionals across modes. Car: 90120=0.75\frac{90}{120}=0.75. Bus: 2550=0.50\frac{25}{50}=0.50. Bike: 525=0.20\frac{5}{25}=0.20. Because these conditional proportions differ substantially (75%75\% vs. 50%50\% vs. 20%20\%), commute length is associated with transportation mode: car users are far more likely to have long commutes than bikers. A segmented bar chart of the three conditional distributions would show this pattern visually.

Practice questions

A researcher records each student's number on their sports jersey. What type of variable is jersey number, and why?
  1. Quantitative, because it is written using digits
  2. Quantitative, because averaging jersey numbers is meaningful
  3. Categorical, because the numbers serve as labels and averaging them is meaningless
  4. Categorical, because there are only a few possible values

Answer: Categorical, because the numbers serve as labels and averaging them is meaningless

A variable stored as digits is not automatically quantitative. The test is whether arithmetic like a mean is meaningful. Averaging jersey numbers produces nothing useful, so jersey number is a categorical variable used purely as an identifier. The number of possible values is irrelevant to variable type.
In a two-way table of 300 people classified by gender (male, female) and pet preference (dog, cat), 80 males prefer dogs. The table shows 150 males total and 180 dog-lovers total. Compute (a) the joint relative frequency of male dog-lovers, (b) the conditional relative frequency of preferring dogs given male, and explain what each proportion describes.

Answer: (a) Joint relative frequency = 80/300 ≈ 0.267; (b) conditional relative frequency = 80/150 ≈ 0.533.

The joint relative frequency divides the cell by the grand total: 803000.267\frac{80}{300}\approx0.267, meaning about 26.7%26.7\% of all 300 people are males who prefer dogs. The conditional relative frequency given male divides the cell by the male total: 801500.533\frac{80}{150}\approx0.533, meaning about 53.3%53.3\% of males prefer dogs. The denominators differ because conditioning on male restricts attention to the 150 males, while the joint proportion considers everyone.
Explain why a segmented bar chart is generally a better choice than two separate pie charts for deciding whether two categorical variables are associated.

Answer: A segmented bar chart lets you directly compare conditional distributions across groups, making differences (and therefore association) easy to see, while pie charts force less accurate area comparisons.

Association is judged by comparing conditional distributions. A segmented bar chart places these distributions side by side on a common scale, so unequal proportions across groups stand out immediately. Pie charts require comparing slice areas across separate circles, which the human eye estimates poorly, and they cannot easily show two variables together. Thus the segmented bar chart reveals association more reliably.

FAQ

How do I quickly tell if a variable is categorical or quantitative?
Ask whether averaging the values makes sense. If computing a mean is meaningful (heights, scores, ages), it is quantitative. If the values are labels or groups even when written as numbers (zip codes, area codes, jersey numbers), it is categorical.
What is the difference between marginal and conditional relative frequency?
A marginal relative frequency uses a row or column total over the grand total and describes one variable alone. A conditional relative frequency uses a cell over a single row or column total, describing one variable within a fixed category of the other. Conditionals are what you compare to check for association.
When should I use a bar chart versus a histogram?
Use a bar chart for categorical data; its bars have gaps because categories are distinct. Use a histogram for quantitative data, where bars touch to show continuous intervals. Choosing the wrong one signals a misunderstanding of variable type on the exam.
How do I show that two variables are associated using a table?
Compute the conditional distribution of one variable for each category of the other. If these conditional distributions differ noticeably, the variables are associated. If they are essentially the same across categories, there is no association. Always state your conclusion in context.

Learn this with a teacher, not a page

The Crimsora tutor teaches U1.1 Variables and Categorical Data live — explaining on a whiteboard, asking you questions, and adapting to where you get stuck.