Simple Linear Regression Calculator
Fit a least-squares line to paired observations and report slope, intercept, correlation, R² and a predicted y value.
A fitted line does not establish causality. Predictions outside the observed x range are extrapolations. Check residuals, outliers, linearity, independence and variance assumptions before formal use.
How to use this calculator
Add at least two paired observations, then enter an x value for prediction. A meaningful model normally needs more observations with variation in x and inspection of the scatterplot and residuals.
Formula
Slope b₁ = Σ[(x − x̄)(y − ȳ)] ÷ Σ(x − x̄)². Intercept b₀ = ȳ − b₁x̄. Prediction ŷ = b₀ + b₁x.
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Expert reviewSaeedM.Phil Statistics, Data Scientist
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
What does the slope mean?
It is the estimated change in y associated with a one-unit increase in x.
What does R-squared mean?
For simple linear regression, R² is the proportion of observed y variation accounted for by the fitted linear relationship with x.
Can I predict beyond the data range?
The tool can calculate it, but extrapolation may be unreliable because the relationship can change outside the observed range.
What are residuals?
Residuals are the differences between observed y values and the values predicted by the line. Looking at them helps check whether a straight line fits the data well.
What is the difference between correlation and regression?
Correlation measures the strength and direction of a linear relationship. Regression estimates the line itself so you can predict y from x.
How do I use the regression equation to predict a value?
Substitute the x value into ŷ = b₀ + b₁x. If the fitted line is ŷ = 2 + 3x, then at x = 4 the predicted value is 2 + 3 × 4 = 14. Predictions are most reliable inside the range of the data used to fit the line.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Kutner, M. H., Nachtsheim, C. J., Neter, J., & Li, W. (2005). Applied linear statistical models (5th ed.). McGraw-Hill Irwin. View source
- Illowsky, B., & Dean, S. (2023). Introductory statistics 2e. OpenStax. View source
- Croarkin, C., & Tobias, P. (Eds.). (2012). NIST/SEMATECH e-handbook of statistical methods. National Institute of Standards and Technology. View source
- Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Routledge. View source
- International Organization for Standardization. (2019). ISO 80000-2: Quantities and units—Part 2: Mathematics. View source