Data & ComputingStatisticsA-Level
AQASATIBAbiturAPBaccalauréat GénéralBachilleratoCambridge

Linear regression Calculator

Predicted value from a linear model.

Use the free calculatorCheck the variablesOpen the advanced solver
This is the free calculator preview. Advanced walkthroughs stay in the app.
Result
Ready
Prediction

Formula first

Overview

Linear regression is a fundamental statistical method used to model the relationship between a scalar dependent variable and one independent variable. It represents the best-fit line through a set of data points by minimizing the sum of the squared differences between observed and predicted values.

Symbols

Variables

= Intercept, = Slope, x = Input x, = Prediction

Intercept
Variable
Slope
Variable
Input x
Variable
Prediction
Variable

Apply it well

When To Use

When to use: Use this model when you want to predict a continuous numerical value based on a single input variable where a linear trend is observed. It is appropriate when the relationship between variables is relatively constant and the residuals (errors) follow a normal distribution.

Why it matters: It serves as the bedrock for predictive analytics in finance, science, and social research. By quantifying the strength of relationships, it allows organizations to forecast future trends, such as sales growth or disease progression, based on historical inputs.

Avoid these traps

Common Mistakes

  • Mixing up beta0 and beta1.
  • Using x in the wrong units.

One free problem

Practice Problem

A retail analyst finds that a store's daily revenue follows an equation where the base revenue is 500 dollars and every additional customer adds 15 dollars. If there are 40 customers today, what is the predicted revenue?

Intercept500
Slope15
Input x40

Solve for: yhat

Hint: Multiply the slope by the number of customers and add the intercept.

The full worked solution stays in the interactive walkthrough.

References

Sources

  1. Wikipedia: Linear regression
  2. Introduction to Statistical Learning: With Applications in R by James, Witten, Hastie, Tibshirani
  3. Statistics by McClave, Benson, Sincich
  4. Wikipedia: Dimensional analysis
  5. James, G., Witten, D., Hastie, T., & Tibshirani, R. (2013). An Introduction to Statistical Learning with Applications in R. Springer.
  6. Montgomery, D. C., Peck, E. A., & Vining, G. G. (2021). Introduction to Linear Regression Analysis (6th ed.). Wiley.
  7. Britannica: Linear regression
  8. Edexcel A-Level Mathematics — Statistics (Regression)