Anscombe and the Datasaurus: why you always plot
Very different pictures can share the same means, spreads and correlation. See it for yourself, then learn what to look for in any scatterplot.
What runs in CodeSplash
- Correlation test (Pearson / Spearman / Kendall) Verified in Python and R
You will be able to
- Explain why a correlation cannot stand in for a scatterplot
- Name four things to look for in any scatterplot
- Decide what to do when a plot contradicts a summary number
Four datasets, one summary
ReadIn 1973 Francis Anscombe built four small datasets with nearly identical means, variances, correlation and fitted line. One is a tidy cloud. One is a smooth curve. One is a perfect line with a single outlier. One is a vertical stack plus one distant point that creates the whole correlation.
A summary table cannot tell them apart. Only a picture can.
Predict the morph
PredictPredict first
You're about to watch a cloud of points slowly rearrange itself into a dinosaur, then a star, then parallel lines. What happens to the correlation?
Reveal
It barely moves. The Datasaurus family keeps means, standard deviations and correlation almost fixed while the picture changes completely.
Watch it happen
ExploreCExplorable · Same statistics, different pictures
How can datasets with identical summaries look nothing alike?
As the cloud morphs into this shape, what happens to Pearson's r?
Target
Mean, SD and correlation are held fixed along the way.
| Mean of x | SD of y | Pearson r | Spearman ρ |
|---|---|---|---|
| 54.30 | 26.90 | −0.060 | −0.029 |
Commit your prediction above to see the result
Make your prediction to see the result.
Keep your eye on the summary numbers while the points move. Then pause on the shape that looks least like "correlation r" should look. Would you report that number to a colleague without showing them the plot?
Four things to look for
ReadEvery time you see a scatterplot, check four things:
- Form: straight, curved, or clustered?
- Direction: up, down, or no trend?
- Strength: how tightly do points follow the trend, and does spread change along it?
- Exceptions: outliers, gaps, or separate groups that a single number would hide.
Separate groups deserve special care. They often mean that a variable you haven't plotted is doing the work.
When picture and number disagree
ReadBelieve the picture, then find out why. A curve suggests a rank coefficient or a transformation. An outlier calls for checking that row before anything else. Separate groups call for coloring by group or controlling for it.
View data
| bill_length_mm | flipper_length_mm | species |
|---|---|---|
| 37.200 | 203 | Adelie |
| 44.300 | 188 | Adelie |
| 45.600 | 193 | Adelie |
| 39.700 | 196 | Adelie |
| 41.600 | 192 | Adelie |
| 36.400 | 187 | Adelie |
| 35.700 | 191 | Adelie |
| 37.800 | 204 | Adelie |
| 35.700 | 183 | Adelie |
| 40.100 | 187 | Adelie |
| 42.800 | 196 | Adelie |
| 39.100 | 194 | Adelie |
| 37.700 | 185 | Adelie |
| 32.100 | 183 | Adelie |
| 39.600 | 182 | Adelie |
| 40.900 | 190 | Adelie |
| 42.400 | 193 | Adelie |
| 35.300 | 190 | Adelie |
| 36.600 | 193 | Adelie |
| 43.400 | 190 | Adelie |
| 38.400 | 182 | Adelie |
| 43.300 | 201 | Adelie |
| 42.500 | 204 | Adelie |
| 38.200 | 198 | Adelie |
| 42.900 | 200 | Adelie |
| 46.200 | 189 | Adelie |
| 35.200 | 197 | Adelie |
| 43.100 | 190 | Adelie |
| 36 | 189 | Adelie |
| 38.900 | 194 | Adelie |
| 36.700 | 196 | Adelie |
| 34.900 | 184 | Adelie |
| 37.900 | 190 | Adelie |
| 36.300 | 175 | Adelie |
| 35.400 | 191 | Adelie |
| 39.300 | 204 | Adelie |
| 38 | 185 | Adelie |
| 40.900 | 201 | Adelie |
| 35.200 | 179 | Adelie |
| 39.200 | 185 | Adelie |
| 39 | 185 | Adelie |
| 35.500 | 186 | Adelie |
| 36.400 | 191 | Adelie |
| 45.900 | 194 | Adelie |
| 35.600 | 191 | Adelie |
| 37.500 | 187 | Adelie |
| 43 | 206 | Adelie |
| 40.400 | 193 | Adelie |
| 39.600 | 180 | Adelie |
| 41.100 | 196 | Adelie |
| 35.900 | 179 | Adelie |
| 33.700 | 173 | Adelie |
| 38.700 | 189 | Adelie |
| 36.800 | 184 | Adelie |
| 31.900 | 183 | Adelie |
| 38.100 | 191 | Adelie |
| 37.100 | 184 | Adelie |
| 38.900 | 189 | Adelie |
| 36.500 | 192 | Adelie |
| 39.100 | 197 | Adelie |
First 60 of 333 rows.
Marginal histograms show each variable's own shape next to the relationship, which makes skew and outliers easier to spot. On a correlation result card, look for the scatterplot and the outlier count before you quote r.
Check your understanding
CheckpointCheck yourself
A report states r = 0.82 with no plot. In the data, all points but one form a vertical stack, and one point sits far to the right. What is the honest reading?
Show the answer
Answer: b
The arithmetic is right, but it describes one point's leverage. This is Anscombe's fourth dataset.
Check yourself
A scatterplot shows two clearly separated clouds, one for each site, and r across the whole dataset is high. What should you do first?
Show the answer
Answer: c
A high overall r can come entirely from the gap between the clouds. Within each site, the relationship may be weak or even reversed.
Check yourself
Put these steps for a new pair of variables in the order that protects you best.
Show the answer
The order:
- Plot the two variables against each other
- Check form, exceptions and groups
- Choose a coefficient that fits what you saw
- Report the coefficient with its interval and the plot
Plot first, because the plot decides which summary is honest. Then report the number and the picture together.
Plot your own pair
In the appOpen Charts or the chart builder under Data → Explore, then pick two numeric columns from your project. Next, run the correlation and compare what the number says with what you saw.
Recap
Recap- Very different datasets can share the same summary statistics, including r.
- Check form, direction, strength and exceptions in every scatterplot.
- Report the plot together with the number. When they disagree, believe the plot and investigate.
Concepts in this lesson