Data & CSV
Simple linear regression
Fit a straight line to paired numeric observations.
A clear answer. Here’s how.
Fits y = intercept + slope × x using ordinary least squares. Pearson correlation and R² are also shown when defined. Both lists must have equal length, at least two observations and non-zero x variance. Association does not establish causation; no predictions beyond the data are implied.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- x values
- 1, 2, 3, 4, 5
- Matching y values
- 2, 4, 5, 4, 5
Example result
- Slope
- 0.6
- Intercept
- 2.2
- Pearson correlation (r)
- 0.774596669241
- R²
- 0.6
- RMSE
- 0.692820323028
- Observations
- 5
Fitted line: y = 2.2 + (0.6 × x)