Calculator inputs
Enter paired X and Y values with matching counts. The calculator estimates the regression line, coefficient intervals, mean response interval, and prediction interval.
Example data table
This sample illustrates a steady positive relationship suitable for testing line fit, interval width, and forecast behavior.
| Observation | X value | Y value |
|---|---|---|
| 1 | 1 | 3.1 |
| 2 | 2 | 4.9 |
| 3 | 3 | 7.2 |
| 4 | 4 | 8.8 |
| 5 | 5 | 10.9 |
| 6 | 6 | 12.7 |
| 7 | 7 | 15.1 |
| 8 | 8 | 17.2 |
Formula used
The calculator applies simple linear regression with Student t based interval estimation for coefficients and future responses.
Core regression equations
Slope: b₁ = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / Σ[(xᵢ − x̄)²]
Intercept: b₀ = ȳ − b₁x̄
Fitted value: ŷᵢ = b₀ + b₁xᵢ
Residual sum of squares: SSE = Σ(yᵢ − ŷᵢ)²
Mean squared error: MSE = SSE / (n − 2)
Confidence and prediction equations
SE of slope: SE(b₁) = √(MSE / Sxx)
SE of intercept: SE(b₀) = √[MSE(1/n + x̄²/Sxx)]
Coefficient interval: estimate ± t* × standard error
Mean response interval at x₀: ŷ₀ ± t*√[MSE(1/n + (x₀ − x̄)²/Sxx)]
Prediction interval at x₀: ŷ₀ ± t*√[MSE(1 + 1/n + (x₀ − x̄)²/Sxx)]
How to use this calculator
- Enter all X values in the first box.
- Enter matching Y values in the second box.
- Choose a confidence level for interval estimation.
- Add a target X₀ when you need a forecast.
- Set display precision and submit the form.
- Review coefficient intervals, fit quality, and forecast bands.
- Export the results using the CSV or PDF buttons.
FAQs
1. What does this calculator estimate?
It fits a simple linear regression line, then reports coefficient estimates, confidence intervals, fit statistics, mean response intervals, and prediction intervals for a chosen target value.
2. What is the difference between confidence and prediction intervals?
A confidence interval estimates the likely range for the mean response. A prediction interval is wider because it covers both mean uncertainty and individual outcome variation.
3. Why must X and Y contain equal counts?
Regression needs paired observations. Each X value must match exactly one Y value, otherwise the model cannot measure the relationship correctly.
4. Why does the tool reject constant X values?
If all X values are identical, there is no horizontal variation. Without X spread, the slope and interval calculations become undefined.
5. Does a higher confidence level always help?
Higher confidence gives more certainty, but intervals become wider. That tradeoff can make forecasts less precise even though coverage improves.
6. What does R-squared mean here?
R-squared shows the share of Y variation explained by the fitted line. Values closer to one suggest a stronger linear fit.
7. Can I paste values separated by new lines?
Yes. The parser accepts commas, spaces, semicolons, vertical bars, and line breaks, making it easy to paste data from spreadsheets or notes.
8. Is this suitable for multiple regression?
No. This page is designed for one predictor and one response. Multiple regression requires matrix estimation and different interval calculations.