Calculator Input
Enter paired numeric values for X and Y. Use commas, spaces, or line breaks. The calculator uses simple linear regression.
Example Data Table
This sample shows ad spend versus generated leads. You can load these values into the calculator using the example button.
| Observation | X: Ad Spend ($000) | Y: Leads |
|---|---|---|
| 1 | 2 | 5 |
| 2 | 4 | 9 |
| 3 | 6 | 12 |
| 4 | 8 | 15 |
| 5 | 10 | 21 |
Formula Used
1) Mean values
x̄ = Σx / n, ȳ = Σy / n
2) Slope coefficient
β₁ = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / Σ[(xᵢ - x̄)²]
3) Intercept coefficient
β₀ = ȳ - β₁x̄
4) Prediction equation
Ŷ = β₀ + β₁X
5) Goodness of fit
R² = SSR / SST = 1 - SSE / SST
6) Residual error metrics
Residual = Y - Ŷ, RMSE = √(SSE / (n - 2))
7) Correlation coefficient
r = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / √(Σ[(xᵢ - x̄)²] Σ[(yᵢ - ȳ)²])
How to Use This Calculator
- Enter all X values in the first box.
- Enter the matching Y values in the second box.
- Keep both lists the same length and order.
- Choose decimal places and an optional prediction X value.
- Click Calculate Regression to view coefficients and diagnostics.
- Review the summary cards, detailed metrics, and observation table.
- Use the CSV button for spreadsheet analysis.
- Use the PDF button for a printable report.
Frequently Asked Questions
1) What does the slope coefficient show?
The slope shows how much Y changes when X increases by one unit. A positive slope means Y tends to rise with X, while a negative slope means Y tends to fall.
2) What does the intercept mean?
The intercept is the predicted Y value when X equals zero. It is useful when zero is meaningful in your dataset and model context.
3) Why must X and Y lists have equal length?
Each X value must pair with one Y value. Unequal lengths break that pairing, so the regression line and residual calculations become invalid.
4) What does R² tell me?
R² measures how much variation in Y is explained by X. Values closer to one suggest the fitted line explains more of the observed pattern.
5) What is the difference between correlation and regression?
Correlation measures association strength and direction. Regression builds an equation that predicts Y from X and estimates coefficient values for that relationship.
6) Can I use this for multiple linear regression?
No. This page is designed for simple linear regression only, using one X variable and one Y variable. Multiple regression needs matrix-based estimation.
7) Why are residuals important?
Residuals show the difference between actual and predicted values. They help you inspect model error, bias, unusual observations, and overall fit quality.
8) When should I avoid linear regression?
Avoid it when relationships are strongly nonlinear, data contain severe outliers, or variance changes sharply across X. In those cases, other models may fit better.