Linear Regression Calculator
Find a least-squares line of best fit, slope, y-intercept, correlation coefficient, R-squared, and predicted values from paired data.
About linear regression
Linear regression examples
| Data points | Fitted result | Interpretation |
|---|---|---|
| (1,2), (2,4), (3,5) | y = 1.5x + 0.666667 | Strong positive relationship with R-squared about 0.964. |
| (1,9), (2,7), (3,5), (4,3) | y = -2x + 11 | A perfect negative linear relationship with r equal to -1. |
| (0,1), (2,5), (4,9) | y = 2x + 1 | Each two-unit increase in x corresponds to four additional y units. |
How to use the linear regression calculator
- Enter each paired observation as x,y and separate pairs with semicolons or line breaks.
- Optionally enter an x value for which you want to predict y.
- Click Calculate Regression to fit the least-squares line.
- Review the equation, slope, intercept, correlation, R-squared, and optional prediction.
Linear regression FAQ
What does the slope mean?
The slope is the estimated change in y for each one-unit increase in x. Its sign gives the direction of the fitted linear relationship.
What is a good R-squared value?
There is no universal cutoff because acceptable fit depends on the field and purpose. Compare it with domain expectations and inspect residual patterns rather than relying on R-squared alone.
Can regression prove causation?
No. A fitted relationship can reflect confounding, selection, coincidence, or reverse causality, so causal claims require appropriate study design and assumptions.
Why should I avoid extrapolation?
The relationship may change outside the observed x range. Predictions far beyond the data therefore rely on an unverified continuation of the fitted line.
How are outliers handled?
Ordinary least squares includes every entered point and squares its residual. As a result, an extreme point can substantially influence the fitted slope and intercept.