Almost every data set can be laid out as a table: one row for each thing that was observed, one column for each thing recorded about it. Knowing what the rows are and what kind of information sits in each column decides which graphs, summaries and inference methods you're allowed to use later in the course.
Observational units and variables
Here are records a county park service keeps on some of its hiking trails:
| Trail | Difficulty | Length (km) | Elevation gain (m) | Bear sightings this year | Dogs allowed |
|---|---|---|---|---|---|
| Cedar Loop | Easy | 3.2 | 85 | 0 | Yes |
| Ridge Run | Hard | 11.8 | 640 | 4 | No |
| Mill Creek | Moderate | 6.5 | 210 | 1 | Yes |
| Hawk Point | Hard | 9.1 | 515 | 2 | No |
| Lakeshore | Easy | 4.4 | 30 | 0 | Yes |
| Pine Hollow | Moderate | 7.6 | 305 | 3 | Yes |
An observational unit is the individual or item that one set of data describes: one row. Here the observational units are hiking trails. A variable is a characteristic recorded for each unit that can differ from one unit to the next: one column. Difficulty, length, elevation gain, bear sightings and whether dogs are allowed are the variables. The trail's name labels the row; it identifies the unit rather than describing it.
Two habits help. To find the observational units, ask "one row is one what?" To find a variable, ask "what was written down about each one?" A variable is never the units themselves ("the trails") and never one value ("11.8 km").
Data don't have to start as numbers or words in a table. A photo, a sound clip, a video or a paragraph of text recorded for each unit carries information too, and you turn it into variables by deciding what to record from it. From a trail camera photo you could record whether a bear appears (yes or no); from a 30-second recording of birdsong you could record the number of distinct species heard; from a written trail review you could record its length in words or whether it mentions mud.
Categorical or quantitative
Variables come in two kinds, and the kind decides what you can do with them.
A categorical variable (also called qualitative) places each unit in a group: difficulty (Easy, Moderate, Hard), dogs allowed (Yes, No), blood type, state of residence. A quantitative variable (also called numerical) records a number that comes from counting or measuring: length in kilometers, elevation gain in meters, bear sightings. Quantitative values usually come with units of measure, and it makes sense to add them, average them, or ask how far apart two of them are.
The test is whether arithmetic means something, not whether the values are digits. A ZIP code is five digits, but the "average ZIP code" of a class is nonsense, and 90210 is not "more" than 10001 in any useful way. ZIP codes, phone numbers, jersey numbers and student ID numbers are labels, so they are categorical. On the other side, a categorical variable can be recorded as a number for convenience (1 = Easy, 2 = Moderate, 3 = Hard) without becoming quantitative.
The same characteristic can often be recorded either way. Length in kilometers is quantitative; length classified as "under 5 km" or "5 km or more" is categorical. When a question asks you to classify a variable, classify it as it was recorded in the study.
Discrete or continuous
Quantitative variables split once more, by what values are possible.
A discrete variable can take only separated values that you could list and count off: 0, 1, 2, 3, and so on. Counts are the usual example: bear sightings, number of siblings, goals in a game. The list can be finite (the number of questions correct on a 20-question quiz is one of 0 through 20) or go on forever as long as you could keep counting through it (the number of e-mails a person receives in a year has no fixed upper limit, but it is always a whole number).
A continuous variable can take any value in an interval: between any two possible values there are more possible values. Measurements of time, length, weight, temperature and volume are continuous. A trail's length could be 6.5 km, 6.51 km, 6.513 km; there's no next value after 6.5.
What gets written down is always rounded, so continuous data look discrete on paper: lengths recorded to the nearest tenth of a kilometer. Classify by the characteristic, not by the rounding. If the quantity is measured on a scale where any in-between value is possible, it is continuous. If it is counted, it is discrete.
Parameters and statistics
Topic 1.1 split every study into a population and a sample. Numbers that summarize a variable split the same way.
A parameter is a number that describes the whole population: the mean length of all 48 trails the county manages, or the proportion of all registered voters in a state who support a ballot measure. A statistic is the same kind of summary computed from a sample: the mean length of the 6 trails in the table, or the proportion of 900 polled voters who support the measure. One way to remember it: population goes with parameter, sample goes with statistic.
AP notation keeps them apart:
| Summary | Parameter (population) | Statistic (sample) |
|---|---|---|
| Mean | ||
| Proportion | ||
| Standard deviation |
The two behave differently. A parameter is one fixed number, but you almost never know it, because finding it takes a census. A statistic is known as soon as you have the sample, but it changes from sample to sample: poll a different 900 voters and you get a somewhat different . A statistic is therefore usually not equal to the parameter it estimates. Its value is that it comes from data you actually have, and the methods in Units 3 and 4 use statistics, plus the way they vary, to draw conclusions about parameters.
For the six trails in the table, the mean length is
That is a statistic, , if these six are a sample of the county's 48 trails. If the county managed only these six, the same 7.1 km would be the parameter . Whether a number is a parameter or a statistic depends on which group it describes, not on the number.
Worked examples
Using the trail table above, identify the observational units, classify each of the five variables, and compute the proportion of trails in the table that allow dogs.
Show solution
One row describes one trail, so the observational units are the hiking trails.
- Difficulty: categorical (Easy, Moderate, Hard are group labels; the order doesn't make them numbers).
- Length (km): quantitative, continuous (a measured distance; any value in an interval is possible).
- Elevation gain (m): quantitative, continuous (a measured height).
- Bear sightings this year: quantitative, discrete (a count: 0, 1, 2, ...).
- Dogs allowed: categorical (Yes or No).
Four of the six trails allow dogs (Cedar Loop, Mill Creek, Lakeshore, Pine Hollow), so : about 66.7% of these six trails allow dogs. It's written if the six are a sample of the county's trails.
A state's motor vehicle department reports that 7.3% of all 2.1 million licensed drivers in the state received a moving violation last year. A research group surveys 600 randomly selected licensed drivers in the state, and 246 of them say they have read a text message while driving in the past month. Identify each number as a parameter or a statistic, and give its symbol.
Show solution
The 7.3% comes from the department's records on all 2.1 million licensed drivers, the whole population, so it is a parameter: , the proportion of all licensed drivers in the state with a moving violation last year.
The survey describes only the 600 drivers who were sampled. , a statistic: 41% of the 600 sampled drivers said they read a text while driving in the past month. The proportion of all the state's drivers who did so is a parameter nobody knows; 0.41 is an estimate of it, and another sample of 600 would probably give a somewhat different value.
A biologist studying smallmouth bass in Lake Okoboji catches 45 bass. For each fish she records its length (cm), its weight (g), its sex, the number of parasites visible on its gills, and a photograph of its tail fin, which she later classifies by fin damage as "none," "minor" or "severe." The mean length of the 45 fish is 31.4 cm.
(a) Identify the observational units in this study.
(b) Classify each of the five variables as categorical or quantitative. For each quantitative variable, state whether it is discrete or continuous.
(c) Is 31.4 cm a parameter or a statistic? Explain, and give the appropriate symbol.
Show solution
(a) The observational units are the individual smallmouth bass caught in Lake Okoboji: each of the 45 fish is one unit.
(b)
- Length (cm): quantitative, continuous, because it is a measurement that can take any value in an interval.
- Weight (g): quantitative, continuous, for the same reason.
- Sex: categorical; each fish is placed in a group (male or female).
- Number of parasites on the gills: quantitative, discrete, because it is a count (0, 1, 2, ...).
- Fin damage, from the photograph: categorical, with values none, minor and severe. The photo is the raw data; the variable is what she records from it.
(c) It is a statistic. 31.4 cm summarizes the lengths of only the 45 bass in the sample, not of all smallmouth bass in the lake. Its symbol is cm. The mean length of all smallmouth bass in Lake Okoboji, , is the parameter, and it is unknown.
Why these moves: part (a) names the units with the study's details (which fish, which lake), not "fish." Part (b) gives a reason with each classification, so a grader sees the rule being applied rather than a lucky guess. Part (c) says which group the number describes, which is the whole reason it's a statistic.
Where students lose points
Check yourself
Question 1
A school records four things about each of its students. Which of them is a categorical variable?
- A
Number of absences this semester
- B
Height in centimeters
- C
Home telephone area code
- D
Minutes spent commuting to school
Show answer
C
An area code is a label for a region: averaging or subtracting area codes means nothing, so it is categorical even though it is written in digits. The other three are counts or measurements, so arithmetic on them makes sense.
- A
Question 2
Which of these quantitative variables is continuous?
- A
The number of text messages a student sent yesterday
- B
The time a runner takes to finish a 5-kilometer race
- C
The number of cars in a parking lot at noon
- D
The number of questions a student answered correctly on a quiz
Show answer
B
Race time is measured and can take any value in an interval (21 minutes 14.3 seconds, 21 minutes 14.31 seconds, ...). The other three are counts, whose possible values are whole numbers you can list.
- A
Question 3
School records show that the mean GPA of all 1,450 students at a high school is 3.12. A random sample of 50 of those students has a mean GPA of 3.05. Identify each number as a parameter or a statistic, give its symbol, and explain why the two numbers differ.
Show answer
is a parameter (it describes all 1,450 students, the population). is a statistic (it describes only the 50 sampled students). They differ because a sample includes only some of the students, and which students land in the sample changes its mean.
Decide which group each number summarizes. A statistic varies from sample to sample, so it is usually not exactly equal to the parameter, even when the sample is chosen at random.
Question 4
A company saves the text of 300 customer reviews of its blender. Name one categorical variable and one quantitative variable it could record from each review, and say whether your quantitative variable is discrete or continuous.
Show answer
Categorical: for example, whether the review mentions the noise level (yes or no), or the star rating category. Quantitative: for example, the number of words in the review, which is discrete because it is a count.
Text is data. A variable is whatever you decide to record from each review: a group it falls in (categorical) or a count or measurement (quantitative). Any correct pair with the right discrete or continuous label is fine.