---
title: "Simple Linear Regression and Inference on the Slope"
description: "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."
canonical: https://lightmysky.com/learn/mathematics/simple-linear-regression-and-inference-on-the-slope-mt_W2huNTKsMj
source: https://lightmysky.com/learn/mathematics/simple-linear-regression-and-inference-on-the-slope-mt_W2huNTKsMj.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# 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.

Subject: Mathematics · Area: Data & Statistics · Ages 21 to 22
Page: https://lightmysky.com/learn/mathematics/simple-linear-regression-and-inference-on-the-slope-mt_W2huNTKsMj

## Ready when they can

- 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

## Lesson: Lines that learn from data

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.

**Example.** 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.

**Tip.** 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.

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

## Practice

14 questions on this page, each with its working shown.

## Needs first

- [Orthogonal Projection and Least Squares](https://lightmysky.com/learn/mathematics/orthogonal-projection-and-least-squares-mt_kGvRrYJrat)
- [The Regression Line and Making Predictions](https://lightmysky.com/learn/mathematics/the-regression-line-and-making-predictions-mt_tsjctRmkyE)
- [One-Way Analysis of Variance](https://lightmysky.com/learn/mathematics/one-way-analysis-of-variance-mt_WYGK3Ktnqz)

## Opens up

- [Galaxies, Redshift and the Expanding Universe](https://lightmysky.com/learn/science/galaxies-redshift-and-the-expanding-universe-mt_-POhqrng-Q)
- [Fitting a Model to Data: Least Squares, Chi-Square and Goodness of Fit](https://lightmysky.com/learn/science/fitting-a-model-to-data-least-squares-chi-square-and-goodness-of-fit-mt_NN0WYlp0md)
- [Multiple Regression and Model Diagnostics](https://lightmysky.com/learn/mathematics/multiple-regression-and-model-diagnostics-mt_TUx1tDF0jv)
