Active experiment

Linear Regression Calculator

Regression line, r, and r².

Step 01 · Set up

Fill in the mathematics

Replace the highlighted values below. Tab moves naturally through the equation.

Step 03 · Answer

Ready when you are

Substitution & process

Enter the known values, then select Calculate. Your working steps will appear here.

Understand the method

What does the linear regression calculation mean?

A least-squares regression line estimates the linear relationship between paired x and y observations. The correlation r gives direction and strength; r² gives the fraction of y-variation explained by this linear model.

When to use it

Use it to summarize paired quantitative data when a scatterplot suggests an approximately linear pattern.

Formula

yˆ=mx+b

In plain text: ŷ = mx + b

Variables and units

SymbolMeaning
mestimated change in y per unit x
bpredicted y when x = 0
rcorrelation from −1 to 1
r²coefficient of determination

How to use the calculator

  1. Enter each known value in its labeled field.
  2. Select the answer precision you want.
  3. Choose Calculate answer to see the result and working.

Worked example

For x = 1, 2, 3 and y = 2, 4, 6, the fitted line is ŷ = 2x, with r = 1 and r² = 1.

Common mistakes

  • Pair x and y values in the same order.
  • Correlation does not establish causation.
  • Avoid extrapolating far beyond the observed x-range.

Interpret the result

The sign of m and r gives direction; values of |r| near 1 indicate a stronger linear association.