Scatter plots, correlation and least-squares regression

MathematicsStatisticsAges 15–16

Loading…

Use with my class ✨ Customize with AI Report a problem

Drag, add or delete points, or paste a table of bivariate data, and see Pearson's r, Spearman's rank coefficient, the least-squares lines (y on x and x on y) and the residual plot update at once. Other screens show high-leverage and influential points, the risks of extrapolation, and a lurking variable that removes or reverses a correlation.

Lesson: Scatter diagrams, correlation and linear regression

What it shows

Each point is a pair (x, y). Pearson's r = Sxy/√(Sxx·Syy) measures how closely the points follow a straight line, from −1 to 1; Spearman's rₛ is r computed on the ranks. The least-squares regression line of y on x minimises the sum of squared residuals and always passes through (x̄, ȳ); the line of x on y is used to estimate x from y. Sample standard deviations divide by n − 1. Most data sets are simulated for teaching, Anscombe's quartet is the published set, and the heights are rounded WHO growth-reference medians.

How to use

On Explore, choose a Dataset and drag points with Move points, or use Add point and Delete point; open Data table (editable) to paste your own values. Compare the four Anscombe sets, then try Exponential in Model on the bacteria data. On Influential points, drag the red point far to the right. On Predict, move Predict at x = beyond the data and tick Show ages 13–18. On Lurking variable, tick Colour by group.

Parameters you can change

  • Screen Explore, Influential points, Predict, Lurking variable
  • Dataset (Explore screen) Height and arm span (simulated), Revision time and test score (simulated), Shoe size and maths score (simulated), Height of a ball over time, Bacteria over time (simulated), Anscombe's quartet I, Anscombe's quartet II, Anscombe's quartet III, Anscombe's quartet IV, Empty (add your own points)
  • Model Linear ŷ = bx + a, Exponential ŷ = A·eᵏˣ (via ln y)
  • Show regression line
  • Show regression line of x on y
  • Show residual plot
  • Age to predict (Predict screen) 0–30 years
  • Show data for ages 13–18 (Predict screen)
  • Lurking variable example Ice cream sales and sunburn, Study time and exam score by course
  • Colour by group (Lurking variable screen)

Questions to explore

  1. Why does the ball data show a clear relationship although r is close to 0?
  2. Where must you drag the red point to change the regression line the most, and why?
  3. Is it sensible to use the regression line to predict a person's height at age 30?