Linear Regression Calculator
Paste paired data, fit a least-squares line, inspect r and R², and estimate y for a chosen x without building the formulas yourself.
Examples
School: study time vs score
Fit a line from study hours and quiz scores, then estimate the score for 6 hours.
- Entry style
- Two lists
- X observations
- 1, 2, 3, 4, 5
- Y observations
- 62, 68, 74, 81, 86
- Paired rows
- 1, 62 2, 68 3, 74 4, 81 5, 86
- Predict y when x =
- 6
Examples
How It Works
Formula
Variables
- Observed x value in pair i
- Observed y value in pair i
- Mean of the x values
- Mean of the y values
- Least-squares slope of the fitted line
- Least-squares intercept of the fitted line
- Correlation coefficient for the linear association
- Share of y variation explained by the line
Linear regression fits one straight line to your paired data. The slope shows how much y tends to change when x increases by 1, and the intercept is the line value when x = 0.
Use this tool when you already have paired observations, such as study time vs quiz score or concentration vs response. A larger absolute r means a tighter linear pattern in the entered points, while R² tells you how much of the variation in y the line accounts for. A useful line can still have a weak fit, and a strong fit still does not prove causation.