Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Learn through experiments

Fit a line and inspect what it misses

How much can one observation change a fitted trend?

Entering midway? A residual is observed output minus predicted output. Least squares chooses the line with the smallest sum of squared residuals.

1 · Try

Start with a concrete question

Original synthetic pairs (1,2),(2,4),(3,6),(4,8) can include a fifth point (5, adjustable y). Inspect fitted slope, residuals and extrapolation.

Try the initial inputs, then write a prediction before changing one setting. All calculations run locally on your CPU.

Go directly to the experiment · Review prerequisite mathematics and return here

2 · Predict

What do you expect?

Predict whether changing the fifth point affects only its own residual.

3 · Experiment

Change one thing. Inspect what happens.

  1. Verify the exact line at default settings.
  2. Move the fifth output to 20 and inspect every residual.
  3. Exclude it and explain what evidence would justify exclusion independently of wanting a cleaner line.
Experiment inputs
Inputs
Your settings
Mechanism
Calculation below
Evidence
Compare outcomes
Fitted slope2
Fitted intercept0
Sum of squared residuals0
Prediction at x=612

Observed points, fitted line and extrapolation

Horizontal: x. Vertical: y.

0-10310630Observed data: (1, 2)Observed data: (2, 4)Observed data: (3, 6)Observed data: (4, 8)Observed data: (5, 10)Least-squares line (extends beyond observed range): (0, 0)Least-squares line (extends beyond observed range): (6, 12)
  • 1. Observed data (points)
  • 2. Least-squares line (extends beyond observed range) (dashed line)

Axes use the displayed ranges.

Read plotted values as a table
Seriesxy
Observed data12
Observed data24
Observed data36
Observed data48
Observed data510
Least-squares line (extends beyond observed range)00
Least-squares line (extends beyond observed range)612

Follow the calculation

  1. Original synthetic pairs: (1,2), (2,4), (3,6), (4,8), (5,10).
  2. Means x=3, y=6. Cross-deviation sum 20; squared-x-deviation sum 10.
  3. Slope = 20/10 = 2; intercept = 6 − 2×3 = 0.
  4. Residuals: 0, 0, 0, 0, 0; squared sum = 0.

Least squares fits observed association. A changed extreme point can change the slope; removing it needs a data-quality reason, not a preferred conclusion.

Captures keep your inputs, prediction and observation. Results are recalculated from those inputs. Resetting inputs keeps your captures and challenge history.

4 · Understand

Explain the mechanism

Fit a line and inspect what it misses

Recap for entering here

A residual is observed output minus predicted output. Least squares chooses the line with the smallest sum of squared residuals.

The concrete question

Original synthetic pairs (1,2),(2,4),(3,6),(4,8) can include a fifth point (5, adjustable y). Inspect fitted slope, residuals and extrapolation.

Predict whether changing the fifth point affects only its own residual.

Work through the mechanism

Least squares balances errors across all included observations. It does not promise that the chosen relationship is causal.

For the default points y=2x exactly, slope is 2, intercept 0 and every residual is zero.

With fifth output 20, mean x=3 and mean y=8. Cross-deviation sum is 40 and squared-x-deviation sum 10, so slope=4 and intercept=−4. Predictions change for all included x values.

Formula and symbols

Slope b=Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²; intercept a=ȳ−bx̄; residual eᵢ=yᵢ−(a+bxᵢ). Overbars denote sample averages.

Test the idea

  1. Verify the exact line at default settings.

  2. Move the fifth output to 20 and inspect every residual.

  3. Exclude it and explain what evidence would justify exclusion independently of wanting a cleaner line.

Assumptions and boundaries

  • No causal identification, confidence band or distributional error model is supplied.

  • Prediction at x=6 extrapolates beyond observed inputs and needs additional validation.

Extend your investigation

High school: Plot an invented scatterplot and explain residuals in its units.

College: Implement least squares and test constant-x degeneracy before extending to multiple regression.

Working professionals: Audit a trend claim for influential observations, extrapolation and confounding.

5 · Apply

Try a fresh case

A fitted line is y=3x−1. At x=4 the observed y is 14. What is the residual?

This is a public practice check. Retries support learning; matching a number does not certify independent proficiency.

Take the investigation further

Choose any extension. These are project prompts for you to carry out; they are not automatically assessed.

School investigation

Plot an invented scatterplot and explain residuals in its units.

College investigation

Implement least squares and test constant-x degeneracy before extending to multiple regression.

Workplace investigation

Audit a trend claim for influential observations, extrapolation and confounding.

6 · Continue

Keep the evidence, choose your next step

Completion records your own decision that you have worked through this investigation. Practice checks and independent project evidence are separate.