Ordinary Least Squares Calculator

Estimate regression coefficients, errors, fit, and residual behavior quickly. Export results and visualize trends clearly. Improve statistical decisions with dependable model summaries and charts.

Enter Paired Data

Use one value per line or separate values with commas. Large screens show three columns, smaller screens show two, and mobile shows one.

Reset

Example Data Table

This sample shows a simple positive linear relationship you can test immediately in the calculator.

Observation X Variable Y Variable
113
224
336
448
559
6611
7712
8814

Formula Used

Slope: b1 = Σ[(xi - x̄)(yi - ȳ)] / Σ[(xi - x̄)²]

Intercept: b0 = ȳ - b1x̄

Prediction: ŷi = b0 + b1xi

Residual: ei = yi - ŷi

R Squared: R² = SSR / SST = 1 - SSE / SST

Standard Error: RMSE = √(SSE / (n - 2))

Ordinary least squares selects the intercept and slope that minimize the total squared residuals. The calculator also estimates coefficient standard errors, t statistics, p values, confidence intervals, model fit, ANOVA components, leverage, standardized residuals, Cook’s distance, and the Durbin-Watson statistic.

How to Use This Calculator

  1. Enter predictor values in the first textarea.
  2. Enter response values in the second textarea using the same order.
  3. Keep both lists equal in length and use at least three pairs.
  4. Optionally rename variables, adjust confidence level, and choose decimal precision.
  5. Press Calculate OLS to view the regression summary above the form.
  6. Review coefficients, p values, intervals, diagnostics, and charts.
  7. Download the results as CSV or PDF when needed.

FAQs

1. What does this calculator estimate?

It estimates a simple linear regression line using ordinary least squares. You get slope, intercept, fitted values, residuals, model fit, coefficient tests, confidence intervals, and observation diagnostics from one calculation.

2. Why must X and Y have equal lengths?

Each X value must pair with exactly one Y value. Regression works on matched observations. If one list has extra entries, the model cannot determine which values belong together.

3. What does the slope mean?

The slope shows the expected change in Y for a one-unit increase in X. A positive slope indicates Y tends to rise as X increases, while a negative slope suggests the opposite.

4. How should I interpret R Squared?

R Squared measures how much variation in the response is explained by the predictor. Values closer to 1 indicate stronger explanatory power, while values near 0 indicate weak linear fit.

5. What are residuals used for?

Residuals show the gap between observed and predicted values. They help you spot patterns, outliers, nonlinearity, and changing variance. A good linear model usually has residuals scattered randomly around zero.

6. What is Cook’s distance?

Cook’s distance estimates how strongly one observation influences the fitted regression line. Larger values suggest an observation may be unusually influential and worth checking before trusting the model summary.

7. When should I use the Durbin-Watson statistic?

Use it when your data have a natural order, especially time-based observations. It helps detect autocorrelation in residuals. Values near 2 suggest little autocorrelation, while much lower values may indicate positive serial dependence.

8. Can I use commas instead of new lines?

Yes. The calculator accepts commas, spaces, and line breaks. It converts them into numeric lists automatically, as long as both variables contain valid numbers and matching observation counts.

Related Calculators

Linear Regression CalculatorMultiple Regression CalculatorLogistic Regression CalculatorSimple Regression CalculatorPower Regression CalculatorLogarithmic Regression CalculatorR Squared CalculatorAdjusted R SquaredSlope Intercept CalculatorCorrelation Coefficient Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.