Worked statistical example

Four datasets. One regression. Four different stories.

Anscombe's quartet is the shortest convincing argument that a statistical summary cannot replace looking at the data.

4 datasets11 points eachSame fitted line6-minute read

The lesson

Summary statistics tell you what they summarize—not what your data look like.

Francis Anscombe constructed four small datasets with nearly identical means, variances, correlations and least-squares regression lines. A table of results makes them look interchangeable. A graph immediately shows that they are not.

The four datasets in Anscombe's quartet Dataset one is roughly linear, dataset two curves, dataset three has one vertical outlier, and dataset four has one high-leverage point. I · roughly linear II · curved III · outlier IV · leverage
The teal line is the same fitted model in every panel: approximately y = 3 + 0.5x. The red points reveal why that agreement is insufficient.

What is nearly identical?

Summary Each dataset What it cannot tell you
Mean of x 9.0 Whether x values have useful spread
Mean of y 7.5 Shape, clusters or unusual observations
Correlation about 0.816 Whether the relationship is linear
Regression y ≈ 3 + 0.5x Whether one point determines the line
about 0.667 Whether residuals support the model

What the plots reveal

  1. Dataset I: a roughly linear pattern where a straight line is a plausible summary.
  2. Dataset II: a clear curve; the linear slope hides systematic structure in the residuals.
  3. Dataset III: one vertical outlier strongly affects the fit.
  4. Dataset IV: ten x values are identical and one high-leverage observation creates the apparent relationship.
Practical rule: graph raw observations and inspect residuals before interpreting a correlation or fitted line. A high R² does not certify the model, and a low R² does not prove there is no scientifically useful structure.

A defensible regression workflow

  1. Start from the scientific question and measurement process.
  2. Plot every observation with meaningful axes and units.
  3. Choose a model whose form corresponds to the question—not merely the best-looking fit.
  4. Inspect residual patterns, influential observations and leverage.
  5. Report the fitted parameters with uncertainty, not only correlation or R².
  6. Explain exclusions and sensitivity analyses; never remove a point only because it changes P.

What Plotwright checks

Plotwright's executable published-example suite runs dataset I through the actual linear-regression and Pearson-correlation engine. The release gate expects slope 0.500, intercept 3.00, R² 0.667, r 0.816 and two-sided P approximately 0.00217 within explicit tolerances. That validates the numerical route; the graph remains essential for judging whether the route answers the scientific question.

Limit: reproducing Anscombe's statistics does not validate every regression option, diagnose a new dataset automatically, or make an influential observation erroneous. Interpretation remains the researcher's responsibility.

Sources and reproducibility

  1. Anscombe, F. J. (1973), “Graphs in Statistical Analysis”—the original article in The American Statistician.
  2. R documentation: Anscombe's quartet—the four machine-readable datasets and references.
  3. Plotwright statistical validation—published expected values, numerical tolerances and evidence limits.

Never separate the analysis from its graph.

Plotwright keeps source data, numerical results, residual diagnostics and editable figures together in one inspectable project.