Regression Calculator
Enter X–Y pairs and this tool will run a simple linear regression of Y on X. You get the regression line (slope & intercept), the correlation coefficient, R², standard error, and a quick ANOVA table. You can also enter an X value to get a predicted Y.
| # | X | Y | |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 |
Equation
—
r (correlation)
—
R²
—
Predicted Y
—
Blue dots: data points; Orange line: fitted regression line (first 60 points shown).
ANOVA (simple regression)
| Source | SS | df | MS |
|---|---|---|---|
| Regression | — | — | — |
| Residual (Error) | — | — | — |
| Total | — | — | — |
Formulas used
Regression line: \( y = a + bx \)
\( b = \dfrac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sum (x_i - \bar{x})^2} \)
\( a = \bar{y} - b\bar{x} \)
Correlation: \( r = \dfrac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}} \)
R²: \( R^2 = 1 - \dfrac{\text{SSE}}{\text{SST}} \)
Interpreting results
- r close to ±1 ⇒ strong linear relationship.
- R² close to 1 ⇒ model explains most of the variability.
- Check the scatterplot to ensure linearity – regression is a linear model.