AP Statistics · Study guide

Say what one row is.

AP® Statistics · Unit 1 · Exploring One-Variable Data and Collecting Data

Variables: What Each Row Records

How to name the observational unit and the variables in any data set, tell categorical from quantitative and discrete from continuous, and keep parameters and statistics apart.

The idea in one paragraph

Before you summarize any data, say what one row describes and what each column records. The row is the observational unit. Each column is a variable. The type of each variable decides which graphs and summaries make sense, so sorting variables correctly comes before everything else.

1Observational units and variables

An animal shelter keeps a record for each dog it takes in. Every record lists the same things: the dog’s size, whether it has been vaccinated, its age, its weight, and how many days it has been at the shelter.

Figure 1. The observational unit is what each row describes, here one dog. A variable is what each column records, and it changes from one dog to the next. The dog’s name only tells you which row is which.

The observational unit is the item or individual that a datum is collected from. In the shelter’s records it is one dog. In other data sets it could be one student, one drink sold, one day of weather, or one tweet.

A variable is a characteristic that can change from one observational unit to another. Weight is a variable because Moose weighs 71.2 pounds and Pepper weighs 12.6 pounds. A value is what one unit has for that variable: “12.6 pounds” is a value of the variable weight.

Worked Example 1 Find the unit and the variables

A coffee shop’s order log

A coffee shop’s register saves a line for every drink it sells: the drink size (small, medium, large), the price in dollars, the number of add-ons (extra shot, syrup, and so on), and the number of seconds the barista took to make it.

What is the observational unit? What are the variables?

  1. 1Ask what one line of the log describes. Each line is one drink sold, so the observational unit is one drink.
  2. 2Each piece of information that changes from drink to drink is a variable: size, price, number of add-ons, and time to make.
  3. 3Name each variable with its units when it has them: price (dollars), add-ons (a count), time (seconds). Size has no units; its values are labels.
Answer: Observational unit: one drink sold. Variables: size, price in dollars, number of add-ons, and time to make in seconds.
Common Mistake 1 · Calling a value a variable

“Large” is not a variable; it is one value of the variable size. “Yes” is a value of vaccinated. If you can ask “what was it for this dog?” and get an answer, you are naming a variable. The answer is a value.

2Categorical or quantitative?

Variables come in two main types.

  • A categorical variable takes values that are category names or group labels: small, medium, large; yes or no; biology, art, history. It is also called a qualitative variable.
  • A quantitative variable takes numerical values that measure or count something, and it usually has units: pounds, years, days, dollars. It is also called a numerical variable.
Figure 2. Ask about the values, not the topic. A zip code is made of digits, but it names a place; it does not count or measure anything, so it is categorical.

The tricky cases are numbers that are really labels. A quick test: would an average make sense? The average age of five dogs means something. The average of five zip codes does not.

VariableValues look likeTypeWhy
Zip code60614, 10027CategoricalIt names a place. Bigger is not “more.”
Jersey number7, 23, 99CategoricalIt identifies a player.
Phone area code312, 415CategoricalA label for a region.
Shoe size8, 8.5, 9QuantitativeIt measures foot length on a scale.
Rating from 1 to 5 stars3, 4, 5Usually treated as quantitativeHigher means better, and averages of ratings are common. Say how you are treating it.
Common Mistake 2 · Treating number labels as quantities

A variable is not quantitative just because its values are digits. Zip codes, ID numbers, and jersey numbers are categorical. Check whether the numbers measure or count something before you average them or draw them on a number line.

3Discrete or continuous?

Quantitative variables split one more time.

  • A discrete variable takes a countable number of values, usually because it comes from counting: days at the shelter, goals scored, siblings. The list of possible values can be finite (0 to 10) or go on forever like the whole numbers, but there are gaps between the values.
  • A continuous variable can take any value in an interval, usually because it comes from measuring: weight, time, height, temperature. Between any two possible values there is always another one.
Figure 3. A discrete variable takes values you can list and count, with gaps in between. A continuous variable can take any value in an interval: between any two weights there is another possible weight.
Discrete (counted)Continuous (measured)
Number of texts sent todayLength of a phone call
Number of pets at homeA dog’s weight
Points scored in a gameTime to run 100 meters
Number of cars in a parking lotAmount of gas in a car’s tank
Common Mistake 3 · Thinking rounding makes a variable discrete

A stopwatch might show 12.4 seconds, but the runner’s real time could be 12.4381 seconds. Recording a measurement to the nearest tenth does not change what kind of variable it is. Time is still continuous. Ask whether the quantity itself is counted or measured.

Worked Example 2 Classify each variable

A school club sign-up form

A sign-up form asks for: (a) whether the student plays a school sport; (b) home zip code; (c) number of clubs already joined; (d) height in centimeters; (e) favorite subject; (f) time to walk to school, in minutes.

Is each variable categorical or quantitative? If quantitative, is it discrete or continuous?

  1. 1(a) Plays a sport: the values are yes and no, which are labels. Categorical.
  2. 2(b) Zip code: digits, but they only name an area. Averaging two zip codes gives nonsense. Categorical.
  3. 3(c) Number of clubs: counted: 0, 1, 2, and so on. Quantitative, discrete.
  4. 4(d) Height: measured, and any value in a range is possible, such as 167.4 cm. Quantitative, continuous.
  5. 5(e) Favorite subject: the values are names like biology or art. Categorical.
  6. 6(f) Walking time: measured on a clock. Even if it is written to the nearest minute, the time itself can be any value. Quantitative, continuous.
Answer: Categorical: plays a sport, zip code, favorite subject. Quantitative discrete: number of clubs. Quantitative continuous: height, walking time.

4Parameters and statistics

Once you have values for a variable, you can summarize them with one number: a mean, a percent, a largest value. What that summary is called depends on where the data came from.

  • A parameter is a number that summarizes a variable for the whole population. It is one fixed number, but it is usually unknown, because measuring the whole population is rarely possible.
  • A statistic is a number that summarizes a variable for a sample. You can calculate it, because you have the sample’s data.
Figure 4. Each sample of 100 students gives its own statistic. None of them has to equal the parameter, the share of all 1,840 students who have a pet. That one number stays put; only the samples change.

A statistic is usually not equal to the parameter. Each sample contains different units, so each gives a slightly different statistic. That is not a mistake; it is what samples do. The statistic is still useful: it is the evidence you use to make a statement about the parameter you cannot see.

Worked Example 3 Parameter or statistic?

Four sentences

Decide whether each number is a parameter or a statistic.

  1. All 312 seniors at a school took the same reading test, and their mean score was 74.
  2. In a survey of 1,500 adults in a state, 58% said they recycle every week.
  3. The city’s records show the mean age of all registered voters in the city is 46.2 years.
  4. A biologist measured 40 frogs from a pond and found that 15% had a spot pattern.
  1. 1Ask the same question each time: does the number summarize the whole group the sentence is about, or just a part of it?
  2. 21. All 312 seniors were tested, so 74 describes the whole population of seniors. Parameter.
  3. 32. 1,500 adults is a sample of the state’s adults. Statistic.
  4. 43. Records of all registered voters give the whole population. Parameter.
  5. 54. 40 frogs are a sample of the pond’s frogs. Statistic.
Answer: Parameters: 1 and 3. Statistics: 2 and 4. A memory hook: population goes with parameter, sample goes with statistic.
Worked Example 4 Two samples, two answers

Who has a pet?

Two classes each choose 100 students at random from the same school of 1,840 and ask, “Do you have a pet at home?” Class A gets 46 yes answers. Class B gets 39. Class B says Class A must have made a mistake. Is that right?

  1. 1Each class found a statistic: \(46 \div 100 = 0.46\) and \(39 \div 100 = 0.39\).
  2. 2The two samples contain different students, so they will almost never give the same result.
  3. 3Both statistics are estimates of one parameter, the share of all 1,840 students with a pet. Neither has to equal it.
  4. 4Only data on all 1,840 students would give the parameter itself.
Answer: No. Different samples give different statistics even when both are done correctly. The parameter is the share of all 1,840 students, and it is still unknown.
Common Mistake 4 · Saying the statistic is the parameter

“46% of students at the school have a pet” is wrong if only 100 students were asked. The 46% describes the sample. Say so: “46% of the 100 students asked have a pet,” or “an estimated 46% of students at the school have a pet.”

5Data beyond numbers

Data do not have to start as a number or a word in a table. Photographs, sounds, videos, and text all carry information, and each can be turned into variables for each observational unit.

Raw dataObservational unitCategorical variableQuantitative variable
Photos from a wildlife cameraone photokind of animal shownnumber of animals in the photo
Recordings of dogs barkingone recordingbreed of the dogloudness in decibels
Videos of free throwsone shotmade or missedheight of the ball at its peak
Online product reviewsone reviewstar rating groupnumber of words
Worked Example 5 Data that start as words

Comments on a bike lane

A city collects 300 written comments about a new bike lane. How can the comments become data you can summarize? Name the observational unit and three variables.

  1. 1Each comment is one observational unit.
  2. 2Read each comment and record answers to questions you set in advance. Does it mention safety? That is a yes or no variable, so it is categorical.
  3. 3Is the overall tone positive, negative, or mixed? Also categorical.
  4. 4How many words does it contain? That is a count, so it is quantitative and discrete.
Answer: Unit: one comment. Variables could be mentions safety (categorical), tone (categorical), and number of words (quantitative, discrete). Text, photos, sounds and videos all become data this way.

6Quick reference

TermPlain meaningShelter example
Observational unitThe item or individual that each row describesone dog
VariableA characteristic that can change from one unit to the nextweight
ValueWhat one unit has for one variable12.6 pounds
Categorical variableValues are category names or group labelssize, vaccinated
Quantitative variableValues are numbers that measure or count, usually with unitsage, weight, days
DiscreteCountable values, with gaps between themdays at the shelter
ContinuousAny value in an intervalweight
ParameterA summary of a variable for the whole populationmean weight of all dogs the shelter has ever housed
StatisticA summary of a variable for a samplemean weight of these five dogs
Three questions for every variable
  1. What is the observational unit, and what does this variable record about it?
  2. Are the values labels (categorical) or numbers that count or measure (quantitative)?
  3. If quantitative: counted (discrete) or measured (continuous)?