Lesson 1.1 · Exploring One-Variable Data
Variables and frequency tables
Statistics is the science of learning from data, and every data set starts the same way: a list of individuals and the variables measured on them. Before you can draw a graph or compute a single number, you need to know what kind of variable you are looking at, because that choice decides which displays and summaries make sense. This lesson sets up the vocabulary you will use for the rest of AP Statistics.
Individuals and variables
The individuals are the objects described by a data set. They can be people, but they can also be animals, cars, schools, days or anything else. A variable is any characteristic that can take different values for different individuals.
A data set is usually organized as a table with one row per individual and one column per variable. Here is a small data set about five used cars on a dealer's lot.
| Car | Make | Model year | Color | Mileage | Price (dollars) | Doors |
|---|---|---|---|---|---|---|
| 1 | Honda | 2019 | Silver | 48,200 | 17,900 | 4 |
| 2 | Ford | 2016 | Blue | 91,550 | 11,400 | 2 |
| 3 | Toyota | 2021 | White | 22,080 | 23,650 | 4 |
| 4 | Honda | 2018 | Black | 63,900 | 15,200 | 4 |
| 5 | Kia | 2020 | White | 35,310 | 19,800 | 4 |
The individuals are the five cars. The variables are make, model year, color, mileage, price and number of doors.
Categorical and quantitative variables
Definition
Categorical and quantitative variables
- A categorical variable places each individual into one of several groups, or categories.
- A quantitative variable takes numerical values for which arithmetic (adding, averaging, finding differences) makes sense.
In the car data, make and color are categorical. Mileage and price are quantitative: it makes sense to say one car costs $3,500 more than another, or to find the average mileage.
The test is not "is it a number?" but "does arithmetic on it mean anything?" Zip codes, jersey numbers, phone area codes and student ID numbers are all written with digits, yet they are categorical. The average of two zip codes is not a place.
Quantitative variables come in two kinds:
- Discrete variables take a countable set of values, often whole-number counts: number of doors, number of siblings, goals in a game.
- Continuous variables can take any value in an interval, limited only by how precisely you measure: mileage, price, height, time.
Worked example: Classifying variables
A researcher records the following for each of dogs at a shelter: breed, weight in pounds, age in months, whether the dog has been microchipped (yes or no), and the number of days the dog has been at the shelter. Identify the individuals and classify each variable.
Individuals: the dogs.
- Breed: categorical.
- Weight: quantitative, continuous.
- Age in months: quantitative. (Recorded in whole months, it behaves like a discrete count, but age itself is continuous. Either description is reasonable; what matters is that it is quantitative.)
- Microchipped: categorical, with just two categories.
- Days at the shelter: quantitative, discrete.
Frequency tables
The distribution of a variable tells you what values the variable takes and how often it takes each value. For a categorical variable, the simplest way to show a distribution is a table.
- A frequency table lists each category with its frequency, the count of individuals in that category.
- A relative frequency table lists each category with its relative frequency, the proportion (or percent) of individuals in that category.
Relative frequency
The relative frequencies of all the categories add to (or ), apart from small rounding errors.
Relative frequencies are what let you compare groups of different sizes. Knowing that students at one school and at another walk to school tells you little until you know how many students each school has.
Worked example: Building a relative frequency table
Forty students were asked how they usually get to school. The frequency table is below. Complete the relative frequency column.
| Mode | Frequency | Relative frequency |
|---|---|---|
| Bus | ||
| Car | ||
| Walk | ||
| Bike | ||
| Other | ||
| Total |
Divide each frequency by :
| Mode | Frequency | Relative frequency |
|---|---|---|
| Bus | ||
| Car | ||
| Walk | ||
| Bike | ||
| Other | ||
| Total |
The relative frequencies add to , as they must. You could also report them as percents: of these students ride the bus.
Worked example: Working backward from percents
In a survey of adults, said their main streaming service is Service A, said Service B, said Service C, and the rest said they don't use a streaming service. How many adults said they don't use one?
The percents must add to , so the missing category is . That's adults.
Frequency tables for quantitative data
A quantitative variable with only a few distinct values, such as number of siblings, can go straight into a frequency table. When a quantitative variable has many different values, group the values into classes of equal width first.
Worked example: Grouping into classes
A coffee shop recorded the number of minutes each of customers waited for their order. The grouped frequency table is below. What proportion of customers waited at least minutes?
| Wait (minutes) | Frequency |
|---|---|
| to less than | |
| to less than | |
| to less than | |
| to less than | |
| to less than |
"At least " means the last two classes: customers. The proportion is .
Notice what the table can't tell you: the exact wait of any single customer. Grouping trades detail for a clearer overall picture.
Common mistake
Don't decide the type of a variable by whether it is recorded with digits. Ask whether averaging or subtracting the values would make sense in context. Area codes, zip codes and ID numbers are categorical; a survey answer coded "agree," "neutral," "disagree" is also categorical, even though the codes are numbers.
Tip
Write every relative frequency as a decimal to the same number of places, then check that they add to . If they add to or , that's rounding. If they add to , you've missed a category.
Practice
A school records these variables for each student. Which one is categorical?
Which variable is quantitative and continuous?
In a sample of cars in a parking lot, were white. What is the relative frequency of white cars? Give a decimal.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A relative frequency table shows the blood types of donors at a blood drive. The relative frequencies are type O: , type A: , type B: . The only other type is AB. How many donors had type AB?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A study of commercial flights out of a regional airport recorded, for each flight in March, the airline, the number of passengers, and the number of minutes the departure was delayed. What are the individuals in this study?
The grouped frequency table shows the lengths, in inches, of fish caught in a lake. What proportion of the fish were at least inches but less than inches long?
| Length (inches) | Frequency |
|---|---|
| to less than | |
| to less than | |
| to less than | |
| to less than | |
| to less than | |
| to less than |
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
In a survey, people chose "Option C," and they made up of everyone surveyed. The relative frequency of "Option A" was . How many people chose Option A?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.