Chapter 1 — Foundations & Types of Data
The module's primary reading · ~30–40 minutes · Objective 1 (distinguish populations from samples and parameters from statistics, classify variables by type and level of measurement, and identify appropriate sampling methods and study designs, including what each can and cannot conclude) · Read it first this week; the lecture, the tutorial, and the quiz all build on it.
In plain language
Statistics is a way to answer a question with data and to be honest about how sure the answer is. This week is about the raw material: where the numbers come from and what kind of numbers they are. You will learn to tell a population (the whole group a question is about) from a sample (the part you actually measure). You will sort every recorded characteristic into its type, because the type decides which summaries make sense. You will also see how the way people are chosen, and the way a study is run, decides what its data can and cannot prove.
Why you already care about this
Between 2007 and 2009, field researchers in Antarctica's Palmer Archipelago logged 344 penguins on three islands. For each bird they wrote down its species, its island, its sex, and four body measurements. That field log is real, and you will meet it all term. This week it raises a simple question. What can 344 birds tell you about penguins in general?
You face the same question every week without calling it statistics. A news poll asks some voters and talks about all of them. A store shows you the star rating from its online reviews. A clinic says most patients felt better after a new routine. Each claim rests on some data, and each one quietly assumes the data came from the right people, in the right way. Sometimes that assumption holds. Sometimes it is the whole problem.
This chapter gives you the questions to ask before you trust any number. Who was measured? What exactly was recorded? How were those individuals chosen? Did anyone assign a treatment, or did the researchers only watch?
By the end of this chapter you will be able to:
- name the question, the data, the conclusion, and the uncertainty in a statistical claim;
- tell a population from a sample and a parameter from a statistic;
- classify a variable as categorical or quantitative, discrete or continuous, and by its level of measurement;
- identify simple random, stratified, cluster, and systematic sampling, and spot a biased method;
- decide whether a study can support a cause-and-effect claim.
Carry this sentence with you: how the data were gathered comes first — not the result.
Where we are
- This week: where data come from and what kind of data they are — populations and samples, types of variables, sampling methods, and study designs.
- How they connect: this chapter is the foundation, so there is no earlier week to lean on; every later week uses the vocabulary you build here.
- Where we're going next: Week 2, Summarizing Data with Tables & Graphs, turns these variables into tables and pictures.
This is the first week of the course, so nothing earlier is assumed. You do not need any math beyond adding, subtracting, and dividing. What you do need is a habit of asking careful questions. Next week you will start drawing data, and the type of each variable you sort this week decides which picture fits it.
1. Statistics: from a question to an honest conclusion
Imagine a friend tells you that penguins weigh about 4 kilograms. You might nod. But a careful listener asks a few things first. Which penguins? How many were weighed? Would a different group of penguins give the same answer?
Those follow-up questions are the heart of statistics. Every statistical claim makes four moves. It starts with a question. It collects data to answer it. It reaches a conclusion. And it says something honest about the uncertainty in between, because a different set of data would have given a somewhat different answer.
Statistics is the practice of answering a question with data: collecting the data, describing them, and reaching a conclusion that says how uncertain it is.
Notice what that definition leaves out. Statistics is not a pile of numbers, and it is not a way to prove things beyond all doubt. It is a careful way to reason when you cannot see everything.
Worked example — the four moves on the penguin field log. Run all four moves on the real field log.
- Question. How heavy are the penguins of the Palmer Archipelago?
- Data. The field log has 344 penguins. Two of them have no body measurements, so 344 − 2 = 342 penguins have a recorded body mass.
- Conclusion. The average body mass of those 342 penguins is 4,201.75 g, a little over 4 kilograms.
- Uncertainty. A different group of penguins from the same islands would give a somewhat different average. So 4,201.75 g is our best answer from this data, not the final word on every penguin.
In words: the field log says these penguins average a little over 4 kilograms, and the honest version of that claim admits it came from one group of birds. Later in the course you will learn to put a number on that uncertainty. For now, the habit is the point.
Misconception check. Students often think a statistic "proves" something because it is a precise number. The precision is tempting: 4,201.75 g sounds exact. But that number describes the 342 measured birds. Whether it describes all penguins depends on how those birds were found, which is exactly what the rest of this chapter is about. A precise number can still answer the wrong question.
Pause and reflect — choose one. Pick either prompt; they count the same.
- (a) Think of a number you heard recently in the news or on social media; which of the four moves (question, data, conclusion, uncertainty) was missing?
- (b) Think of a decision you made this month based on reviews or ratings; what question were those ratings really answering?
Memory hook: question, data, conclusion, uncertainty — four moves, every time.
2. Population and sample: tell the whole from the part
Picture a café owner who wants to know what her customers think of a new menu. She cannot ask every person who has ever walked in. So she asks some of them and hopes they speak for the rest. That everyday move, asking some to learn about all, has two names you will use all term.
- A population is the entire group of individuals that a question is about.
- A sample is the part of a population that is actually observed or measured.
The individuals do not have to be people. They can be penguins, months, patients, or receipts. The population is set by the question, not by the data you happen to have. If the question is about penguins in the Palmer Archipelago, the population is every penguin there. The 344 penguins in the field log are a sample of that population.
We use two letters to keep the sizes straight. The letter n (the number of individuals in a sample) counts what you measured. The letter N (the number of individuals in a whole population) counts everything the question covers.
Numbers that summarize these groups get names too.
- A parameter is a number that describes a whole population, such as an average over every individual in it.
- A statistic is a number computed from a sample, such as the average of the measured individuals; it estimates the matching parameter.
Worked example — a sample and a population side by side. Put the penguins next to a die.
The penguins. The field log counts 152 Adelie, 68 Chinstrap, and 124 Gentoo penguins. Add them: 152 + 68 + 124 = 344. So n (the sample size) is 344. The average body mass of the 342 measured birds, 4,201.75 g, was computed from that sample, so it is a statistic. Nobody knows the matching parameter, the average over every penguin in the archipelago. That is the point of taking a sample.
The die. Now think of a fair six-sided die. Its faces are 1, 2, 3, 4, 5, and 6. Here you can list the whole population, so N (the population size) is 6 faces. Their average is 3.5. Because 3.5 describes every face there is, it is a parameter. You did not estimate it. You know it.
In words: the penguins give you a statistic that estimates an unknown parameter, while the die gives you a parameter you can see directly. Most real questions look like the penguins.
Misconception check. Students often say "a parameter is what you calculate from your data." That reverses the two words. You calculate a statistic from your sample. A parameter belongs to the whole population, and in real life you usually cannot see it at all. Keep the pairs together: Parameter goes with Population, and Statistic goes with Sample.
The population can also change when the question changes. Suppose a follow-up team can revisit only some of the 344 logged birds. For that new question, "the 344 logged penguins" is the whole population, and the birds the team revisits are the sample. Same birds, different question, different population. Always ask what the question is about before you name the population.
3. Types of data: sort every variable before you summarize it
Look at a coffee order: a size, a drink name, a price, and a time. Some of those are labels and some are amounts. You would never add two drink names together, but you might add two prices. That difference is the next big idea.
A variable is a characteristic recorded for each individual that can differ from one individual to the next, such as species or body mass. Variables come in two broad kinds.
- A categorical variable is a variable whose values place each individual into a group or category, such as species or island.
- A quantitative variable is a variable whose values are numbers that count or measure an amount, so arithmetic on the values makes sense.
Quantitative variables split once more.
- A discrete variable is a quantitative variable whose possible values can be listed with gaps between them, such as a count or a calendar year.
- A continuous variable is a quantitative variable that can take any value in a range, limited only by how precisely it is measured, such as a mass in grams.
The four levels of measurement
A variable's level of measurement is the scale it is recorded on — nominal, ordinal, interval, or ratio — and it decides which summaries make sense for it. This four-level scheme was introduced by S. S. Stevens in 1946, and statisticians still use it.
- Nominal is the level for names or labels with no natural order. Only counts and the most common category make sense. Species is nominal: no species comes "before" another.
- Ordinal is the level for values with a natural order but unequal gaps between them. Coffee sizes (small, medium, large) are ordinal. Large is bigger than medium, but the gap from small to medium need not equal the gap from medium to large. Counts and the middle value of the ordered list make sense.
- Interval is the level with equal gaps but no true zero. Differences and averages make sense, but ratios do not. A calendar year is interval: two years apart is the same gap anywhere on the calendar, but year zero is not "no time at all."
- Ratio is the level with equal gaps and a true zero that means none of the quantity. Differences, averages, and ratios all make sense. Body mass is ratio: 0 grams means no mass, so "twice as heavy" means something real.
The levels stack. Each one allows everything the level before it allows, plus something new. That gives you a rule for the whole course: the most common category works at every level; the middle value needs at least ordinal data; an average needs interval or ratio data.
Worked example — classifying the penguin field log. The field log records eight variables for each bird. Here is how each one sorts.
| Variable | Categorical or quantitative | Discrete or continuous | Level of measurement |
|---|---|---|---|
| species | categorical | (not quantitative) | nominal |
| island | categorical | (not quantitative) | nominal |
| sex | categorical | (not quantitative) | nominal |
| year | quantitative | discrete | interval |
| bill length (mm) | quantitative | continuous | ratio |
| bill depth (mm) | quantitative | continuous | ratio |
| flipper length (mm) | quantitative | continuous | ratio |
| body mass (g) | quantitative | continuous | ratio |
Walk through the reasoning, not only the answers. Species, island, and sex are labels with no order, so they are categorical variables at the nominal level. Year is a number you can subtract, so it is quantitative. It moves in whole steps, so it is discrete, and it has no true zero, so it is interval. The four body measurements are amounts that could land anywhere in a range, and zero means none, so they are continuous quantitative variables at the ratio level.
In words: of the eight variables, three are labels, one is a discrete interval count of years, and four are continuous ratio measurements. That sorting tells you, before any calculation, that an "average island" is meaningless while an average body mass is fine.
Here is a second, smaller case from the calendar. The number of days in a month (28, 30, or 31) is quantitative, because you can add days. It is discrete, because a month cannot have 30.6 days. And it is ratio, because zero days would mean none.
Misconception check. Students often treat any number as quantitative. Suppose someone codes the species as 1 for Adelie, 2 for Chinstrap, and 3 for Gentoo, then reports an "average species." The codes are numbers, but they are only labels in disguise. Species is still nominal, and an average of category labels means nothing. Ask what the value measures, not whether it is written with digits. A jersey number or a locker number is a label, too.
In practice (your tools). In Google Sheets, click cell A1 of a blank sheet and type =IMPORTDATA("https://raw.githubusercontent.com/allisonhorst/palmerpenguins/main/inst/extdata/penguins.csv"). The eight column headers land in row 1 and the 344 penguins fill rows 2 through 345. In any empty cell, =COUNTA(A2:A345) counts the species entries and returns 344. The file writes a missing value as the text NA, so =COUNTIF(G2:G345,"NA") counts the birds with no recorded sex and returns 11. That is why 344 − 11 = 333 penguins have a recorded sex. In Excel, use Data, then From Text/CSV, and open the same file after saving it.
4. Sampling methods: choose who gets measured, and watch for bias
Think about tasting a pot of soup. You stir it, then taste one spoonful, and you trust that spoonful to speak for the pot. The stirring is what earns that trust. Without it, you might taste only the salty layer on top. Choosing a sample works the same way: how you choose matters more than how much you take.
Here are the four standard ways to choose a sample with chance built in.
- A simple random sample is a sample chosen so that every possible group of n individuals from the population is equally likely to be the one selected.
- A stratified sample is a sample made by splitting the population into groups that share a trait and then taking a simple random sample from every group.
- A cluster sample is a sample made by splitting the population into groups, choosing some whole groups at random, and measuring every individual in the chosen groups.
- A systematic sample is a sample made by starting at a random position on a list and then taking every k-th individual after it.
In a systematic sample, k (the step between chosen individuals) is set by dividing the list size by the number you want.
Worked example — three plans for revisiting the penguins. Suppose a follow-up team wants to revisit some of the 344 logged penguins. For this question the 344 birds are the whole population. Compare three plans.
Systematic plan. The team wants 43 birds. Divide the list size by the number wanted: k = 344 ⁄ 43 = 8. Pick a random starting position from 1 to 8, then take every 8th penguin in the log. That gives 43 birds spread evenly through the list.
Stratified plan. The team wants 86 birds and wants each species represented in its true share. Take one in every four from each species:
- Adelie: 152 ⁄ 4 = 38
- Chinstrap: 68 ⁄ 4 = 17
- Gentoo: 124 ⁄ 4 = 31
Check the total: 38 + 17 + 31 = 86. Within each species, the team picks its birds by simple random sampling.
Cluster plan. The team treats each island as a cluster. Biscoe has 168 logged penguins, Dream has 124, and Torgersen has 52, and 168 + 124 + 52 = 344. If chance picks Torgersen alone, the team revisits 52 penguins, and every one of them is Adelie.
Compare the effort: the systematic plan takes one in 8 birds, versus one in 4 for the stratified plan, so the stratified team does 2-fold the work for 2-fold the birds. A field team choosing between them weighs that cost against the guarantee that every species appears.
In words: the systematic plan spreads 43 picks evenly, the stratified plan guarantees all three species in their true shares, and the cluster plan is the cheapest trip but can miss whole species. A cluster plan works best when every cluster looks like a small copy of the population. These islands do not, so a one-island cluster sample here would mislead.
Two methods that build in bias
Not every way of choosing a sample uses chance.
- A convenience sample is a sample made of the individuals who are easiest to reach; it builds in bias because easy-to-reach individuals often differ from the rest.
- A voluntary-response sample is a sample made of the people who choose to respond, often those with the strongest feelings; it builds in bias.
Here bias means a built-in tendency of a sampling or study method to miss the truth in the same direction every time it is used; a bigger sample does not remove it.
Picture a campus dining survey handed out only at the late-night snack counter. That is a convenience sample. Everyone in it eats late, so it will tilt toward late-night tastes. Now picture an online store's product reviews. Customers who loved or hated the product are the ones most likely to write in. That is a voluntary-response sample, and it tilts toward strong feelings at both ends.
Misconception check. Students often believe that a bigger sample fixes a biased method. Picture that store with thousands of reviews. It is tempting to think so many reviews must be accurate. But every extra review comes through the same door: people who chose to write. A bigger sample only makes the result less jumpy from one sample to the next. It does not change the direction of the tilt. The cure is a better method, not more of the same one.
Honesty note: even a well-chosen random sample will not match the population exactly. Chance still moves the result a little from sample to sample. Random choice makes that wobble fair and measurable. Bias does not wobble; it leans.
In practice (your tools). To draw a simple random sample of the penguins in Google Sheets, type =RAND() in cell I2 and fill it down to I345, so every bird gets a random number. Then select the data and use Data, then Sort range, to sort by column I, and take the first rows you need. For the systematic plan, =RANDBETWEEN(1,8) picks the random start; then count down the list in steps of 8.
5. Studies and experiments: know what can prove a cause
Imagine a clinic notices that patients who take a daily walk report better sleep. Should everyone start walking for sleep? Maybe. But the walkers chose to walk. They might also eat differently, work different hours, or worry less. Any of those could explain the better sleep.
That story shows the last big distinction of the week.
- An observational study is a study in which researchers record what they find without assigning any treatment to the individuals.
- An experiment is a study in which researchers deliberately assign treatments to the individuals and then measure the response.
- A randomized experiment is an experiment that uses chance to decide which individual gets which treatment, so the groups differ only by chance apart from the treatment; only this design supports a cause-and-effect conclusion.
Why does chance matter so much? When a coin flip, not the patient, decides who walks, the walkers and the non-walkers end up alike in every other way, on average. Then a difference in sleep can be traced to the walking.
Worked example — what kind of study is the penguin field log? Ask one question: did the researchers assign anything? They did not. They recorded the penguins they found, on the islands where they found them. So the field log is an observational study.
Now look at one pattern in it. All 124 Gentoo penguins in the log were recorded on Biscoe. Does living on Biscoe make a penguin a Gentoo? No. The birds were not assigned to islands; species and island travel together in this data. That is an association, not a cause. You also could not run an experiment here. No researcher can randomly assign a penguin to a species.
Compare a fresh case. A campus learning center wants to know whether a new study app raises quiz scores. If it lets students choose the app, the students who choose it may already study more. If instead it flips a coin for each volunteer to decide who gets the app, the two groups start out alike. Only the second design could show that the app causes a change.
In words: watching tells you what goes together, and only a randomized experiment tells you what causes what.
Misconception check. Students often think a strong pattern in a big observational study proves a cause. The size of the study is tempting, because more data feels like more proof. But a big observational study can be big and still confounded: something other than the treatment can differ between the groups. Size shrinks chance error; it does not create random assignment.
Caveat: experiments are not always possible or ethical. You cannot assign people to smoke or assign penguins to islands. In those cases, careful observational studies are the best evidence available, and honest writers say "is associated with," not "causes."
Key terms
- statistics — The practice of answering a question with data: collecting the data, describing them, and reaching a conclusion that says how uncertain it is. (first used: 1. Statistics: from a question to an honest conclusion)
- population — The entire group of individuals that a question is about. (first used: 2. Population and sample: tell the whole from the part)
- sample — The part of a population that is actually observed or measured. (first used: 2. Population and sample: tell the whole from the part)
- parameter — A number that describes a whole population, such as an average over every individual in it. (first used: 2. Population and sample: tell the whole from the part)
- statistic — A number computed from a sample, such as the average of the measured individuals; it estimates the matching parameter. (first used: 2. Population and sample: tell the whole from the part)
- variable — A characteristic recorded for each individual that can differ from one individual to the next, such as species or body mass. (first used: 3. Types of data: sort every variable before you summarize it)
- categorical variable — A variable whose values place each individual into a group or category, such as species or island. (first used: 3. Types of data: sort every variable before you summarize it)
- quantitative variable — A variable whose values are numbers that count or measure an amount, so arithmetic on the values makes sense. (first used: 3. Types of data: sort every variable before you summarize it)
- discrete variable — A quantitative variable whose possible values can be listed with gaps between them, such as a count or a calendar year. (first used: 3. Types of data: sort every variable before you summarize it)
- continuous variable — A quantitative variable that can take any value in a range, limited only by how precisely it is measured, such as a mass in grams. (first used: 3. Types of data: sort every variable before you summarize it)
- level of measurement — The scale a variable is recorded on, nominal, ordinal, interval, or ratio, which decides which summaries make sense for it. (first used: 3. Types of data: sort every variable before you summarize it)
- nominal — The level of measurement for names or labels with no natural order; only counts and the most common category make sense. (first used: 3. Types of data: sort every variable before you summarize it)
- ordinal — The level of measurement for values with a natural order but unequal gaps between them; counts and the middle value of the ordered list make sense. (first used: 3. Types of data: sort every variable before you summarize it)
- interval — The level of measurement with equal gaps but no true zero, so differences and averages make sense while ratios do not. (first used: 3. Types of data: sort every variable before you summarize it)
- ratio — The level of measurement with equal gaps and a true zero that means none of the quantity, so differences, averages, and ratios all make sense. (first used: 3. Types of data: sort every variable before you summarize it)
- simple random sample — A sample chosen so that every possible group of n individuals from the population is equally likely to be the one selected. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- stratified sample — A sample made by splitting the population into groups that share a trait and then taking a simple random sample from every group. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- cluster sample — A sample made by splitting the population into groups, choosing some whole groups at random, and measuring every individual in the chosen groups. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- systematic sample — A sample made by starting at a random position on a list and then taking every k-th individual after it. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- convenience sample — A sample made of the individuals who are easiest to reach; it builds in bias because easy-to-reach individuals often differ from the rest. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- voluntary-response sample — A sample made of the people who choose to respond, often those with the strongest feelings; it builds in bias. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- bias — A built-in tendency of a sampling or study method to miss the truth in the same direction every time it is used; a bigger sample does not remove it. (first used: 4. Sampling methods: choose who gets measured, and watch for bias)
- observational study — A study in which researchers record what they find without assigning any treatment to the individuals. (first used: 5. Studies and experiments: know what can prove a cause)
- experiment — A study in which researchers deliberately assign treatments to the individuals and then measure the response. (first used: 5. Studies and experiments: know what can prove a cause)
- randomized experiment — An experiment that uses chance to decide which individual gets which treatment, so the groups differ only by chance apart from the treatment; only this design supports a cause-and-effect conclusion. (first used: 5. Studies and experiments: know what can prove a cause)
Summary
- Every statistical claim makes four moves: a question, data, a conclusion, and honest uncertainty.
- The population is the whole group the question is about; the sample is the part you measure.
- A parameter describes the population; a statistic comes from the sample and estimates it.
- Sort each variable as categorical or quantitative, discrete or continuous, and by level of measurement.
- The level decides the summary: most common category at any level, middle value from ordinal up, average only for interval or ratio.
- Simple random, stratified, cluster, and systematic sampling all use chance to choose.
- Convenience and voluntary-response samples build in bias, and a bigger sample does not fix it.
- Only a randomized experiment supports a cause-and-effect conclusion; an observational study shows association.
Check your understanding
Work these before looking at the answers — they are ungraded, and the answers (with reasoning) are at the bottom of the page.
- A city library records, for each borrowed book, its genre (mystery, history, poetry, and so on) and the number of days until it was returned. Classify each variable as categorical or quantitative, and give its level of measurement.
- A hospital wants patient feedback from each of its departments, so it picks patients at random within every department. Which sampling method is this, and why is it a good fit?
- A fitness app emails all its users a link to a survey about how much they enjoy the app. Name the sampling problem and explain why getting more replies would not solve it.
- A researcher compares commuters who chose to bike to work with commuters who drive, and finds the bikers report lower stress. Can the researcher conclude that biking lowers stress? Explain what kind of study this is and what design would be needed.
Answers (worked reasoning — read after attempting)
- Genre is a categorical variable. Its values are labels with no natural order, so it is nominal, and the sensible summary is the most common genre. Days until return is a quantitative variable: you can subtract and average days. It counts whole days, so it is discrete, and zero days means no time at all, so it is at the ratio level.
- This is a stratified sample. The departments are the groups (strata), and the hospital takes a random sample inside each one. It fits because every department is guaranteed a voice, and a small department cannot be left out by bad luck.
- This is a voluntary-response sample: users decide for themselves whether to answer. People with strong feelings, often the biggest fans or the most annoyed users, are the likeliest to reply, so the results lean in their direction. More replies come through the same door, so the lean stays. Only a different method, such as surveying users chosen at random and following up with them, removes the bias.
- No. The commuters chose how to travel, and nobody assigned it, so this is an observational study. Bikers may differ from drivers in other ways, such as distance from work or how much exercise they get elsewhere. To show that biking causes lower stress, you would need a randomized experiment that uses chance to assign volunteers to bike or drive. The honest conclusion from this study is that biking is associated with lower stress.
Next up in this module: the Readings & Resources page, the lecture tutorial, the practice set, and the quiz — and next week each variable's type sets the rule for which table or graph it gets.
Built with The Course Maker · samples.thecoursemaker.com