What a data set is made of
In Topic 1.1 you met populations, samples and data. This topic gives you the words to describe exactly what was recorded and about whom. Almost every free-response question in the course starts by asking you to read a study carefully. If you can name the observational units and the variables, and say what type each variable is, you know which graphs and summaries make sense later.
Think of a data set as a table:
- Each row is one observational unit: the item or individual that the data are about.
- Each column is one variable: a characteristic recorded for every unit.
- Each cell is one datum: the value of one variable for one unit.
Observational units: who or what the data describe
An observational unit is the item or individual from which a piece of data is collected. It might be a person, but it does not have to be. It can be a household, a tree, a school, a day, a car, a photograph or a tweet.
To find the observational units, ask: “Each value in the data set describes one … what?”
- A survey records the number of people living in each of 40 homes. The units are the 40 households, not the people.
- A weather station records the rainfall on each of 30 days. The units are the 30 days.
- An app company records the number of words in 200 customer reviews. The units are the 200 reviews.
Be careful with the word “unit”. Observational units are the things being studied. Units of measure (kg, minutes, kWh) are what a quantity is measured in. They are different ideas.
Variables
A variable is a characteristic that can change from one observational unit to another. “Number of people living in the household” is a variable because it differs from home to home.
A variable must be recorded for every unit in the same way. “The town” is not a variable in a study of households in one town, because it is the same for every household. It describes the population, not a characteristic that changes.
Data are not only numbers
Data can come from many sources: a form, a sensor, a photograph, a sound recording, a video or a piece of text. You usually turn these into variables by recording something about each one. For example:
| Source | A categorical variable you could record | A quantitative variable you could record |
|---|---|---|
| Photo of a garden bird | species shown | number of birds in the photo |
| 10-second voice recording | language spoken | time taken to say a set sentence (seconds) |
| Customer review (text) | whether it mentions “delivery” (yes/no) | number of words |
| Video of a tennis serve | whether the serve was in (yes/no) | ball speed (km/h) |
The photo, recording or text is the raw data. The variables are the characteristics you measure from it.
Categorical and quantitative variables
There are two main types of variable.
A categorical variable (also called a qualitative variable) takes values that are category names or group labels. Examples: main heating fuel (gas, electric, oil, wood), whether a review mentions delivery (yes, no), favourite subject, postcode district.
A quantitative variable (also called a numerical variable) takes numerical values that are measured or counted amounts. It usually has units of measure. Examples: electricity used last month (kWh), number of people in a household, height (cm), time (seconds).
A quick test: does arithmetic on the values make sense? If an average such as “a mean of 2.5 people per household” means something, the variable is quantitative. If the average is nonsense, such as “the mean postcode district is 15.6”, the variable is categorical, even though its values are written as numbers.
Discrete and continuous quantitative variables
Quantitative variables are split again.
A discrete variable takes a countable number of values. You could list them: 0, 1, 2, 3, … The list may stop (number of correct answers on a 20-question quiz: 0 to 20) or go on for ever (number of emails received in a day: 0, 1, 2, … with no fixed maximum). “Goes on for ever” is still countable, so it is still discrete. Counts are the usual discrete variables.
A continuous variable can take any value in an interval. Between any two possible values there is always another possible value. Measurements of time, length, mass, volume and temperature are continuous. A runner’s time could be 12.8 s, 12.83 s, 12.834 s, and so on.
Rounding does not change the type. A stopwatch may show 12.83 s, so the recorded values have two decimal places. The time itself can still be any value in an interval, so the variable is continuous. Ask what the characteristic is, not only how the display shows it.
Parameters and statistics
Once data are recorded, we summarise them with numbers such as a mean or a proportion. What we call that number depends on whose data it summarises.
- A parameter is a numerical summary of a variable for a population: every unit of interest.
- A statistic is a numerical summary of a variable for a sample: the units we actually observed.
Memory aid: Population and Parameter; Sample and Statistic.
We usually cannot measure the whole population, so the parameter is usually unknown. We calculate a statistic from the sample and use it to estimate the parameter. A statistic is usually not exactly equal to the parameter. A different random sample would contain different units and would usually give a slightly different statistic. This is not a mistake; it is natural variation from sample to sample. Later in the course you will measure how large this variation is, which is the basis of inference.
To decide which you have, ask: “Does this number come from every unit in the population, or only from the units in a sample?” The size of the number, and whether it is a mean or a proportion, does not matter.
Background (notation used later in the course). Parameters are often written with Greek letters, for example μ for a population mean and σ for a population standard deviation. The matching statistics are x̄ and s. You will meet x̄ and s in Topic 1.7 and μ and σ in Topic 1.9; for now, the words are what matter.
Worked example 1: a household energy survey
Context (fictional). The council of Kestrel Bay wants to know about energy use in the town’s 1,250 households. It chooses 40 households at random. A researcher visits each one, takes a photo of the electricity meter, and records the variables below. The first six rows are shown.
| Household | People living there | Main heating fuel | Electricity used last month (kWh) | Postcode district | Solar panels? |
|---|---|---|---|---|---|
| 1 | 3 | Gas | 284.6 | 12 | No |
| 2 | 1 | Electric | 412.0 | 07 | Yes |
| 3 | 5 | Gas | 356.2 | 12 | No |
| 4 | 2 | Wood | 198.9 | 31 | No |
| 5 | 4 | Electric | 530.4 | 07 | Yes |
| 6 | 2 | Oil | 240.7 | 25 | No |
Of the 40 households, 9 have solar panels.
Question. (a) Identify the observational units, the population and the sample. (b) Classify each variable in the table. (c) Calculate the proportion of sampled households with solar panels. Is it a parameter or a statistic? What is the matching parameter?
(a)
- Each row describes one household, so the observational units are households.
- The population is all 1,250 households in Kestrel Bay (N = 1,250).
- The sample is the 40 households chosen at random (n = 40).
(b) “Household” (1 to 6) is only a row number, so it is not a variable of interest.
| Variable | Type | Reason |
|---|---|---|
| People living there | quantitative, discrete | a count: 1, 2, 3, … |
| Main heating fuel | categorical | values are the names of fuels |
| Electricity used last month | quantitative, continuous | a measured amount in kWh; can be any value in an interval |
| Postcode district | categorical | the numbers are labels; a mean district number means nothing |
| Solar panels? | categorical | values are yes or no |
The electricity values were read from the meter photos. The photo is the source; the variable is the amount of electricity.
(c) Proportion = 9 ÷ 40 = 0.225 (22.5%). It summarises the sample, so it is a statistic. The matching parameter is the proportion of all 1,250 Kestrel Bay households that have solar panels. It is unknown; the council uses 0.225 to estimate it.
Check. Could the parameter be exactly 0.225? That would mean 0.225 × 1,250 = 281.25 households, which is impossible. So in this case the statistic cannot equal the parameter exactly, as the theory says is usual.
Worked example 2: parameter or statistic?
Context (fictional). Ridgeway College has 3,100 students. Read each statement. Name the variable and its type, and decide whether the number is a parameter or a statistic.
- College records show that 1,922 of the 3,100 students (62%) take at least one science course.
- In a random sample of 150 students, the mean sleep time last night was 6.8 hours.
- In the same sample, the median number of text messages sent yesterday was 34.
- Each of the 150 students also recorded a short voice clip reading the same sentence. For each clip, a researcher noted whether background noise could be heard.
Solution.
- Variable: whether a student takes a science course (yes/no), categorical. The 62% uses every student in the population (1,922 ÷ 3,100 = 0.62), so it is a parameter.
- Variable: sleep time last night, quantitative, continuous (hours, any value in an interval). The 6.8 hours comes from 150 sampled students only, so it is a statistic.
- Variable: number of texts sent, quantitative, discrete (a count). The median of 34 is from the sample, so it is a statistic. A median can be a statistic just as a mean can.
- Variable: background noise audible (yes/no), categorical. The observational unit is still the student; the clip is the source of the data.
Follow-up. A second random sample of 150 Ridgeway students gives a mean sleep time of 7.1 hours. Does this mean one sample is wrong? No. The two samples contain different students, so their statistics differ by 0.3 hours. Neither is likely to be exactly equal to the mean sleep time of all 3,100 students, which is the unknown parameter.
Common misconceptions
- “If it is written as a number, it is quantitative.” Postcodes, ID numbers, phone numbers and jersey numbers are labels. They are categorical.
- “The observational units are always people.” In Worked example 1 they are households; in other studies they may be days, trees or photos. Ask “one row describes one what?”
- “Units means kg or cm.” Observational units are the things studied. Units of measure are kWh, seconds and so on. Read the question carefully.
- “A variable with no maximum value is continuous.” The number of emails in a day has no fixed maximum but can only be 0, 1, 2, … It is countable, so it is discrete.
- “A rounded measurement is discrete.” Time shown to 0.01 s is still continuous; the rounding comes from the instrument, not from the characteristic.
- “A mean is a parameter and a proportion is a statistic” (or the reverse). The type of summary does not decide it. Population gives a parameter; sample gives a statistic.
- “The statistic differs from the parameter, so the sample was done badly.” Statistics vary from sample to sample even with good random sampling.
- “A photo or a piece of text is not data.” Photos, sounds, videos and text are data. You record variables from them.
Where this leads
You now know how to describe what a data set contains. Next, in Topic 1.3, you will summarise a categorical variable with frequency and relative-frequency tables. Quantitative variables follow in Topics 1.5 to 1.7. If you need to review populations and samples, see Topic 1.1. Try the practice questions now, then use the revision notes and the checklist to consolidate.
Quick questions
Is a postcode or phone number a quantitative variable?
No. It is written with digits, but it is a label. Adding or averaging postcodes gives a meaningless answer, so the variable is categorical.
Is age discrete or continuous?
Time since birth is continuous: it can take any value in an interval. If a study records age only in whole years, the recorded values are whole numbers, but many statisticians still treat age as continuous. In a written answer, say how the variable is measured and give your reason.
How do I remember which is a parameter and which is a statistic?
Match the first letters: Population goes with Parameter, Sample goes with Statistic.