Fit the least-squares line ŷ = b₀ + b₁x to your data and get the full output you would expect from statistical software. That includes coefficients with standard errors, t-tests, p-values and confidence intervals; R² and adjusted R²; the ANOVA table; the Durbin–Watson statistic; predictions with confidence and prediction intervals; and a residual plot for checking assumptions.
Understanding the output
- Slope b₁: the expected change in Y for a one-unit increase in X. Its p-value tests whether the slope differs from zero.
- Intercept b₀: the predicted Y when X = 0. It is only meaningful if X = 0 is within or near your data.
- R²: the proportion of variation in Y explained by X.
- Standard error of the estimate: the typical size of a prediction error, in Y’s units.
- Durbin–Watson: checks whether residuals are correlated in order (important for time series). Values near 2 are good.
Formulas
b₁ = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)² · b₀ = ȳ − b₁x̄ · R² = 1 − SSE ÷ SST
Confidence interval vs prediction interval
The confidence interval at x gives the plausible range for the average Y of all observations with that x. The prediction interval gives the range for a single new observation, so it is always wider. Use the prediction interval when forecasting an individual case.
Checking assumptions
- Linearity: the scatter plot should look like a straight-line trend.
- Constant variance: the residual plot should show an even band with no funnel shape.
- Independence: no pattern in residuals over time (Durbin–Watson near 2).
- Normal residuals: mainly matters for small samples and prediction intervals.
Frequently asked questions
Can I predict outside my range of X?
You can, but it is extrapolation. The relationship may not hold beyond the data you observed, and the calculator warns you when you do it.
What is the difference between regression and correlation?
Correlation measures the strength of a relationship symmetrically. Regression treats one variable as the predictor and gives an equation for predicting the other. In simple regression, R² equals r².