Linear regression

Fit a line to pasted data: slope, intercept, R² and a scatter plot.

8 points read.

Equation
y = 2.021429x + 0.028571
0.99712

99.71% of the variation in y is explained by x

Correlation (r)
0.998559

Very strong

Slope
2.021429

y changes by this much per unit of x

Intercept
0.028571

Predicted y when x = 0

Standard error
0.287435

Typical distance from the line

Scatter and fitted line

0.448.560.94817.652

Dotted lines are the residuals — the vertical gaps the fit minimises.

Predict

Predicted y
20.242857
Extrapolating?
Yes — outside your data

Residuals

Mean residual
0

Always ~0 for a least-squares fit

Largest positive
0.3
Largest negative
-0.37857
Residual spread (sd)
0.26611

How it works

Least-squares regression finds the single straight line that minimises the sum of squared vertical distances between the line and your points. Squaring is what makes the answer unique and computable in closed form — and also what makes the fit sensitive to outliers.

slope b = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² intercept a = ȳ − b·x̄ R² = r², the fraction of variance in y explained by x

Reading R²

R² runs from 0 to 1. It is the proportion of the variation in y that the line accounts for. 0.9 is a tight fit; 0.3 means the line captures a real but minor part of what is going on. A high R² does not mean the model is right — only that a line describes this data well.

Correlation is not causation, and the line is not the truth

A strong fit tells you two variables move together. It cannot tell you which causes which, or whether something else causes both. Anscombe's quartet — four datasets with identical slope, intercept and R² but wildly different shapes — is the standard reminder to look at the scatter plot before believing the numbers.

Extrapolation

Predicting inside your observed range is interpolation and is usually reasonable. Predicting outside it assumes the relationship keeps holding, which nothing in your data supports. The tool flags when you cross that line.