Linear Regression Calculator (Least Squares Line)

Find the least-squares regression line ŷ = bx + a from x and y data — slope, intercept, r, R², standard errors, slope test and…

Results

Enter your details and click Calculate to see your results.
About This Calculator

b = Sxy/Sxx and a = ȳ − b·x̄ minimise Σ(y − ŷ)². SE(b) = s/√Sxx with s = √(SSE/(n − 2)); t = b/SE(b) with n − 2 df.

Example

Example: x = 1–5, y = 2 4 5 4 5 → ŷ = 0.6x + 2.2, R² = 0.6.

Assumptions

Separate values with spaces, commas or new lines; x and y must have the same count.

Frequently Asked Questions

What does R² mean?

The share of the variation in y explained by the line — 0.6 means 60%.

Can I extrapolate?

Predictions far outside the x range are unreliable — the linear pattern may not continue.

Related Calculators

About the Author

Imran Hossain
Imran Hossain

Professional SEO, Digital Marketer Specialist

I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist

View full profile