The datasets
where they come from, and what each column means
The files
What this page is for: here, for each data file, is where it comes from and exactly what each column means — with the unit alongside, what is in it, and how much is missing. Not a lesson — a reference. It sits at the back because you don’t have to read it beforehand; you open it the moment you think, in the middle of an exercise: hang on, what is that, actually? From every exercise an arrow points here, in the data strip at the top.
These are the files the exercises use. To look one up: the table of contents alongside names each file, and every column is written exactly as it is in the file — so searching for bill_depth_mm works.
In every table, what is in it gives the lowest and the highest number that occurs, or for a word column every value with how often it occurs — so Adelie (151) means: the word Adelie, 151 times. Missing counts the empty spots. Those numbers come from the files themselves: they are read from them when the Dutch original of this page is built, and this English page is checked against that original number by number — so if it ever says 342 when the file has long said something else, the check says so. What was written by hand is the meaning — that a column is called bill_depth_mm, the data tells you; that it is the height of the bill and not the width, someone has to tell you.
id is not a measurement — and once, it lies outright
Two files here have a column id: penguins.csv and bigfive.csv. In both it is the row number — the first row is called 1, the second 2, up to the last. Nothing was measured. Nobody picked up a penguin and read a 137 off it.
That looks harmless, and it is not. Put id next to bill_length_mm — as a correlation matrix, the table that compares every column with every other, does for every pair — and this is what comes out:
The association between
idandbill_length_mm, over all 342 animals, is r = .77.
Now set that beside the measurements that do matter. There are four body measurements in this file, and you can compare them two at a time in six ways. Of those six associations only one is stronger than this — the one between flipper length and weight (r = .87). So a row number beats almost everything we actually measured.
And yet the penguins did not grow longer bills by row number. What happened is this: the three species sit in the file in blocks, one after another, because they were counted per species and pasted together that way. And those species differ in bill length:
| species | row numbers | animals | mean bill length | r between id and bill_length_mm within that species |
|---|---|---|---|---|
Adelie |
1 to 151 | 151 | 38.79 mm | .01 |
Gentoo |
152 to 274 | 123 | 47.50 mm | .21 |
Chinstrap |
275 to 342 | 68 | 48.83 mm | .02 |
Within one species little of that is left: at most r = .21, for Gentoo — a small association, where over all the animals together it was .77. It is the species that goes with the bill, and id merely numbers them, one species after another. That is exactly the same third player as in the exercise on correlation and the scatterplot, where the species dresses itself up as an association between bill length and bill depth. Here it dresses up as the row number.
And to show that the rule is not “id is secretly strong”: bigfive.csv holds just such a row number, and there the largest association with any item at all is r = .05. Next to nothing — that file happens not to be sorted on anything.
What this gives you: a column that only counts does not belong in an analysis. Whether it lies depends on the order the file is in — and you cannot see that order from the number.
And mind what it does not say. Further on you will meet D, DxS and beautiful. Those are not new measurements either but derived columns, and each one says so — but that is not a ban. DxS does belong in an analysis — that is what it was made for. The difference from id is that with a derived column you know where it comes from, and so you do not put it next to its own source in the same model.
stones.csv — the twelve stones from the book
These twelve are ours. They come not from an archive but from the book itself: Anna through to Leen are the stones with which the book tells the whole story, from the mean in chapter 1 to the crow in chapter 12. So few rows that you take them in at a glance, with just enough columns to practise everything on — and small enough to check every number by hand if you don’t believe it.
One thing was deliberately adjusted, and you ought to know it in case you ever come across an older printout: on 9 August 2026, 0.6 carat was added to every stone. Before that the mean was exactly 1.00, and now it is 1.60.
Why that was done — you can safely skip this until you reach chapter 4. Further on you learn centring: taking the mean off every value, so that zero comes to lie on the mean. With a mean of exactly 1.00 that is the same as subtracting 1, and then you can’t see what is actually happening. There is a second gain too. The regression line has a starting point: what it predicts at zero carats. With these numbers that is a negative shine — and a stone of zero carats does not exist, so that starting point means nothing. Not an address where nobody lives, but an address that does not exist. Exactly the reason to centre, and much easier to explain when you see it happen. Such a shift, by the way, touches only that starting point: the slope, r, R² and p stay exactly the same.
One row is one stone. The file has twelve of them, in nine columns.
| column | what it is | unit | what is in it | missing |
|---|---|---|---|---|
name |
The name of the stone, twelve names in alphabetical order. | — | Anna (1) · Bram (1) · Cees (1) · Dora (1) · Else (1) · Faas (1) · Geer (1) · Hans (1) · Ida (1) · Joop (1) · Kees (1) · Leen (1) |
none |
carat |
The weight of the stone. | carats (1 carat = 0.2 grams) | from 1.0 to 2.1 | none |
shine |
How brightly the stone shines, on a scale from 0 to 100. | points | from 20 to 80 | none |
smoothness |
How well it is cut, from rough to mirror-smooth, on a scale from 0 to 10. | points | from 1 to 8 | none |
brand |
The brand of the cutting works: the little mark it sets in the stone. | — | ripple (6) · star (6) |
none |
D |
The same as brand, but as a number: 1 for a star, 0 for a ripple. Not a second measurement — a recoding of the column next to it. |
0 / 1 | from 0 to 1 | none |
DxS |
D × smoothness, the product of those two columns. Not a measurement either but a computed column; it sits ready for the moderation exercise. |
0 / 1 × points | from 0 to 8 | none |
taken |
Did the crow pick up this stone that night? 1 is yes. | 0 / 1 | from 0 to 1 | none |
beautiful |
1 if the shine is above 50. No exercise uses this column any more; it is there from an earlier version of the workbook. | 0 / 1 | from 0 to 1 | none |
penguins.csv — penguins off Antarctica
Between 2007 and 2009 the biologist Kristen Gorman and her colleagues walked three small islands of the Palmer archipelago, right by the American research station in Antarctica. They were looking for nests of three penguin species — Adélie, Gentoo and Chinstrap (the one with the thin black line under its chin, hence the name) — and for every animal they could get hold of they noted down the bill, the flipper and the weight. The question behind that work had nothing to do with us: they wanted to know how males and females of the same species differ in size, and how that ties in with what there is to eat in the sea.
This is real fieldwork, and it shows. The source counts 344 animals; for two of them one of the measurements failed, and we left those out. For nine of the remaining animals the sex was never established — they are in, with NA in that spot. The measurements are freely available (CC0).
For most of the animals the researchers also took a little blood, at the start of the breeding season. A lab read from it what the animal had eaten in the weeks before. Those are the last two columns, nitrogen and carbon.
Careful, because the names wrong-foot you: there is no amount of nitrogen or carbon in there. Every number is a difference from a fixed reference point that is set at zero. On nitrogen all the penguins sit above it, on carbon all of them below — which is why that column is negative. What they say is about the food:
nitrogen— what the animal ate. The higher the number, the more fish and the less krill (the tiny shrimps at the bottom of the food chain).carbon— where the animal looked for its food. Which way means what, we leave aside here; use it to compare groups, not to interpret a single animal.
One number on its own says little; it comes alive when you lay groups side by side. The mean of nitrogen per species: Adelie 8.86, Gentoo 8.25, Chinstrap 9.36. Chinstrap sits highest: that species ate, on average, a little more fish in those weeks than the other two.
For twelve animals a result is missing. In that spot it says NA, and that can happen in two ways:
- eleven animals are missing both columns: nine times there was too little blood, twice no blood was taken;
- one animal is missing only
nitrogen: the result never came back from the lab.
That is not an error in the file but a gap from the field, and it has a consequence. Compute with nitrogen, and those animals cannot take part: you compute with 330 penguins instead of 342; with carbon with 331, and with both at once also with 330 — not fewer, because whoever is missing carbon is missing nitrogen too. So look first at how many are missing, and write down how many animals you computed with.
One row is one penguin, picked up and measured once. The file has 342 of them, in nine columns.
| column | what it is | unit | what is in it | missing |
|---|---|---|---|---|
id |
The row number, nothing more — see the warning above. Not a measurement on a penguin. | — | from 1 to 342 | none |
species |
The penguin species. | — | Adelie (151) · Gentoo (123) · Chinstrap (68) |
none |
sex |
As the researchers wrote it down in the field, in English. For some animals it was not established; there it says NA. |
— | male (168) · female (165) |
9 |
bill_length_mm |
The length of the bill, from where it starts to the tip. | millimetres | from 32.1 to 59.6 | none |
bill_depth_mm |
The height of the bill, not its width: how tall the profile is from top to bottom. See the sketch above. | millimetres | from 13.1 to 21.5 | none |
flipper_length_mm |
The length of the flipper, the wing a penguin swims with. | millimetres | from 172 to 231 | none |
body_mass_g |
What the whole animal weighs. | grams | from 2700 to 6300 | none |
nitrogen |
What this animal ate, read from its blood: the higher, the more fish and the less krill. Not an amount — see above. In articles this number is called δ¹⁵N; you don’t need to know that name. | ‰ (per thousand, as a difference from a reference point — not a concentration) | from 7.63 to 10.03 (rounded; the file has five decimals) | 12 |
carbon |
Where this animal looked for its food, read from its blood. Not an amount, and negative because the penguins sit below the reference point — see above. In articles this number is called δ¹³C; you don’t need to know that name either. | ‰ (per thousand, as a difference from a reference point — not a concentration) | from −27.02 to −23.79 (rounded; the file has five decimals) | 11 |
airquality.csv — a summer over New York
From 1 May to 30 September 1973, measurements were taken over New York every day. The ozone comes from the New York State Department of Conservation, which measured on Roosevelt Island between one and three in the afternoon; the weather data come from the National Weather Service. And mind: each number comes from a different spot in the city. The sun was measured in Central Park, the wind and the temperature at LaGuardia airport. That is not sloppiness but the usual way of things with air measurements — and it is at once a good reason to be careful with “the temperature that day”.
Ozone at street level is the stuff smog is made of, and it forms when sunlight acts on exhaust fumes — so you expect more ozone on warm, sunny, windless days. The source counts 153 days; on some of them the ozone measurement failed. We kept the days on which it did work — and even within those days the solar radiation is still missing five times. That comes with it: a series of measurements with gaps is the normal state, not an error.
One row is one day. The file has 116 of them, in five columns.
| column | what it is | unit | what is in it | missing |
|---|---|---|---|---|
ozone |
The mean amount of ozone in the air, between 13:00 and 15:00. | ppb (parts per billion) | from 1 to 168 | none |
solar_r |
How much solar radiation fell on the ground that morning between 08:00 and 12:00. On a few days this was not measured. | langley | from 7 to 334 | 5 |
temp_F |
The highest temperature that day. In degrees Fahrenheit, not Celsius: the coldest day here is 57 °F, or 13.9 °C, and the warmest 97 °F, or 36.1 °C. | degrees Fahrenheit | from 57 to 97 | none |
wind |
The mean wind speed, measured at 07:00 and at 10:00. | miles per hour | from 2.3 to 20.7 | none |
month |
Which month the day fell in: 5 is May, 9 is September. | month number | from 5 to 9 | none |
bigfive.csv — 25 questions about yourself
From a large online personality study that the psychologist William Revelle ran from 2010 (the SAPA project). Participants were shown statements about themselves and said, for each statement, how well it fitted them, on a scale from 1 (very inaccurate) to 6 (very accurate). The statements themselves come from the International Personality Item Pool, a freely usable collection of personality questions.
Two words from the source description to carry with you: self-report and online. Nobody spoke to these people, measured them or checked up on them. They landed on a website, filled in what they thought of themselves, and left again. Whoever took part picked themselves; what is there is what someone wrote down about themselves. That is no reason to put the file away — it is how a large part of personality research gets its data — but it is the reason there are things in it that cannot be. One of them is below, and that one is worth keeping.
The source has 25 statements and 2800 people, and those 25 belong to five traits of five statements each: agreeableness (A1–A5), conscientiousness (C1–C5), extraversion (E1–E5), neuroticism (N1–N5) and openness (O1–O5). All 25 are in here, with age, sex and level of education alongside.
We keep 2634 of the 2800 people: everyone who answered all ten neuroticism and openness statements. That is a choice from an earlier version of this file, left in on purpose, so that the exercises that already count on it keep their numbers.
So on the other columns an answer is missing here and there — exactly how many is in the column missing below, per column. When you work out a trait, let those people drop out. So rowMeans(...) and not rowMeans(..., na.rm = TRUE): the latter averages over whichever questions someone happened to fill in, so that whoever answered one of the five gets a scale score made from one question — and in the column it looks exactly like all the others.
Seven of the 25 statements are reversed. “Don’t talk a lot” belongs to extraversion, but whoever agrees with that sentence is in fact less extraverted. In the table below every such item carries a warning. Average the five statements of a trait without reversing them first, and you add two directions together and measure something other than you think — how hard that hits, you see in the exercise on Cronbach’s alpha (in Dutch). The neuroticism statements are the only five that all point the same way.
You reverse by subtracting the score from 7 — the two ends of the scale added together. Whoever filled in a 2 at “Don’t talk a lot” gets a 5 after reversing.
The statements are below exactly as they were put to the participants.
The ages run from 3 to 86. That 3 is odd. But it is not impossible: someone can mistype, or make a joke. Look only at the ages and you see a strange number and nothing more — and you have no grounds at all to do anything with it.
Now look at the column next to it. That same participant ticks the highest level of education: higher education finished, and further study after that. A child of 3 with a university degree. That cannot be.
Mind what just happened. In age there is a strange value; in education a perfectly ordinary one (there are hundreds with the same). Neither column stands out when you look at it on its own. The error is not in a column but between two columns, and by definition you cannot find that by going through the columns one at a time. That is the move you learn here: lay two side by side and ask yourself whether that combination can exist.
How rare that is, in this file: of the 231 participants under eighteen, exactly one gives a level of education you cannot have finished before your eighteenth birthday. That is this one.
And the rest of the young people stay in too. There are 26 twelve-year-olds in this file and 59 sixteen-year-olds. They are real: that is exactly who fills in a personality test on a website. Drawing an age limit because the lowest value is no good would cost 231 people to clear up one row.
And that is why that one row is still in. We have not removed it. Whoever wants it out may take it out — but with the reason alongside, because that is exactly what a researcher is supposed to write down.
What this row is not good for — you can skip this until you get to the assumptions. It looks like a textbook example of a point that pulls the regression line askew, and it is not. Recomputed on neuroticism ~ age: with this participant the slope is −0.011920, without them −0.011893. That is a difference of 0.2 per cent, and you will not see it in any output.
That is not because the row is ordinary. It lies far out, in fact: its age is the lowest of all. On the measure of exactly that — leverage, how far an observation sits from the rest along the x-axis — it scores 0.0024, and that is more than the 0.0023 above which leverage usually counts as striking. So it really is a leverage point, and it is not even the only one: 92 participants pass that line.
But lying far out is not the same as pulling. Its neuroticism score is 3.8 and the line predicts 3.5 for it — it sits almost exactly where the line expects it, and there is nothing to shift about a point that lies on the line. The measure that takes those two things together is Cook’s D: far out on the x-axis and far from the line. Here it is 0.000095, where the rule of thumb only starts to beep at 1.
So the lesson is in two parts, and they are often mixed up. Far out on the x-axis (leverage) and shifting the line (influence) are not the same thing; the first is a condition for the second, not proof of it. And a point weighs, in any case, in proportion to how few other points there are: with 2634 observations that share is tiny, however odd the observation itself. If you want to see what one point can do to a line, you need a small file — that is what the twelve stones are for. This row belongs to checking your data, before you start computing.
One row is one completed questionnaire, so one person. The file has 2634 of them, in 29 columns.
| column | what it is | unit | what is in it | missing |
|---|---|---|---|---|
id |
The row number, nothing more. Not a measurement on a person — see the warning above. | — | from 1 to 2634 | none |
age |
How old this participant says they are. Read the warning above before you compute with this column. | years | from 3 to 86 | none |
sex |
Male or female, as the participant ticked it. The source offered only these two choices. | — | female (1759) · male (875) |
none |
education |
How far this participant got, as a step: 1 secondary school not finished · 2 secondary school finished · 3 some higher education · 4 higher education finished · 5 further study after that. It is there as a number because the steps have an order, and that is exactly what loose words lose. Mind: if you want to compare the five groups, you first have to make a grouping variable of it — in R that is factor(education). Put the bare number into a model and you assume every step is the same size, and that is an assumption, not a given. |
step 1 to 5 | from 1 to 5 | 209 |
A1 |
“Am indifferent to the feelings of others” — reversed: whoever scores high here is in fact less agreeable. | scale point | from 1 to 6 | 11 |
A2 |
“Inquire about others’ well-being” | scale point | from 1 to 6 | 20 |
A3 |
“Know how to comfort others” | scale point | from 1 to 6 | 18 |
A4 |
“Love children” | scale point | from 1 to 6 | 11 |
A5 |
“Make people feel at ease” | scale point | from 1 to 6 | 14 |
C1 |
“Am exacting in my work” | scale point | from 1 to 6 | 18 |
C2 |
“Continue until everything is perfect” | scale point | from 1 to 6 | 15 |
C3 |
“Do things according to a plan” | scale point | from 1 to 6 | 13 |
C4 |
“Do things in a half-way manner” — reversed: whoever scores high here is in fact less conscientious. | scale point | from 1 to 6 | 16 |
C5 |
“Waste my time” — reversed: whoever scores high here is in fact less conscientious. | scale point | from 1 to 6 | 12 |
E1 |
“Don’t talk a lot” — reversed: whoever scores high here is in fact less extraverted. | scale point | from 1 to 6 | 17 |
E2 |
“Find it difficult to approach others” — reversed: whoever scores high here is in fact less extraverted. | scale point | from 1 to 6 | 11 |
E3 |
“Know how to captivate people” | scale point | from 1 to 6 | 17 |
E4 |
“Make friends easily” | scale point | from 1 to 6 | 8 |
E5 |
“Take charge” | scale point | from 1 to 6 | 18 |
N1 |
“Get angry easily” | scale point | from 1 to 6 | none |
N2 |
“Get irritated easily” | scale point | from 1 to 6 | none |
N3 |
“Have frequent mood swings” | scale point | from 1 to 6 | none |
N4 |
“Often feel blue” | scale point | from 1 to 6 | none |
N5 |
“Panic easily” | scale point | from 1 to 6 | none |
O1 |
“Am full of ideas” | scale point | from 1 to 6 | none |
O2 |
“Avoid difficult reading material” — reversed: whoever scores high here is in fact less open. | scale point | from 1 to 6 | none |
O3 |
“Carry the conversation to a higher level” | scale point | from 1 to 6 | none |
O4 |
“Spend time reflecting on things” | scale point | from 1 to 6 | none |
O5 |
“Will not probe deeply into a subject” — reversed: whoever scores high here is in fact less open. | scale point | from 1 to 6 | none |
Where they come from — the sources in one list
If you want to dig further yourself, or have to account for a dataset in a report, these are the places to find them.
The references are in APA form, because this is exactly the kind of list someone copies from. For an article, only the journal name and its volume number are in italics — the title of the article is not.
| file | original source |
|---|---|
stones.csv |
No literature source: the twelve stones from The Regressive Backbone. |
penguins.csv |
Gorman, K. B., Williams, T. D., & Fraser, W. R. (2014). Ecological sexual dimorphism and environmental variability within a community of Antarctic penguins (genus Pygoscelis). PLoS ONE, 9(3), e90081. https://doi.org/10.1371/journal.pone.0090081 — collected by the Palmer Station Antarctica LTER, distributed as the R package palmerpenguins (CC0). |
airquality.csv |
Chambers, J. M., Cleveland, W. S., Kleiner, B., & Tukey, P. A. (1983). Graphical methods for data analysis. Wadsworth & Brooks/Cole. — The measurements themselves come from the New York State Department of Conservation (ozone) and the National Weather Service (weather), May–September 1973; shipped with R as airquality. |
bigfive.csv |
Revelle, W., Wilt, J., & Rosenthal, A. (2010). Individual differences in cognition: New methods for examining the personality-cognition link. In A. Gruszka, G. Matthews, & B. Szymura (Eds.), Handbook of individual differences in cognition: Attention, memory and executive control. Springer. — The statements come from Goldberg, L. R. (1999). A broad-bandwidth, public domain, personality inventory measuring the lower-level facets of several five-factor models. In I. Mervielde, I. Deary, F. De Fruyt, & F. Ostendorf (Eds.), Personality psychology in Europe (Vol. 7). Tilburg University Press. As bfi in the R package psych. |