LightMySky

Simple Linear Regression and Inference on the Slope

State regression as a model with an error term, estimate its slope by least squares, then test and bound that slope. Residual plots are the check on whether the model was reasonable.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Write the model with its error assumptions
  • Test whether a slope differs from zero and give an interval for it
  • Read a residual plot for curvature and changing spread

1 · Read

The simple linear model writes each response as an intercept plus a slope times the predictor plus random error. The error term collects everything the line cannot explain, and the model assumes those errors centre on zero with steady spread and no pattern. Least squares picks the line that minimises the sum of squared residuals. The slope predicts how much the response changes for a one unit step in x.

To test whether the slope differs from zero you divide the slope estimate by its standard error and compare the ratio to a t distribution. A tiny p value means the line explains more than chance would, and the matching interval bounds the slope. A large p value never proves the slope is zero; it only means the data do not rule zero out.

Try it together

A fitted line is y hat equals 2 plus 3x. At x equals 4 you predict 2 plus 12, which is 14. If the actual y is 15, the residual is observed minus predicted, which is 1. Predictions inside the observed x range interpolate safely, while far outside points extrapolate and may fail.

Good to know

Read the residual plot before trusting any p value. A curve means the link is not straight, and a fan that widens with x means the spread changes. Both patterns break the conditions behind the test, so fix the model first.

Model the line, test the slope, and let the residuals check your work.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Where this leads

Jobs that lean on this skill. Follow one to see everything it is built on.

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Simple Linear Regression and Inference on the Slope · Mathematics, ages 21 to 22 · LightMySky