Multiple Regression Calculator
Multiple linear regression models a response variable as a straight-line combination of two or more predictors, fitting an intercept and a slope coefficient for each predictor so that the model best matches the observed data. It is one of the most widely used tools in statistics and science for measuring how several factors jointly relate to an outcome. This calculator fits the standard ordinary least squares model with two predictors, y equals b0 plus b1 times x1 plus b2 times x2, using five data rows. It solves the normal equations exactly, the system that minimizes the sum of squared differences between observed and predicted values, so the coefficients are the unique least squares estimates for your data. You enter the two predictor values and the response for each of the five observations, and the calculator returns the intercept b0 and the two slope coefficients b1 and b2. Each slope tells you the change in the response associated with a one-unit increase in that predictor while the other is held constant. Every figure is computed deterministically by solving the normal equations, never approximated or guessed, so the same data always gives the same coefficients. The method and a worked example that reconciles exactly to the calculator default appear in full below.
Ordinary least squares fits y = b0 + b1*x1 + b2*x2 by solving the normal equations. For the default data, the exact fit is b0 = 2.00, b1 = 1.00 and b2 = 3.00, since y was built as 2 + x1 + 3*x2.
Formula
y = b0 + b1 x1 + b2 x2
Coefficients solve the normal equations (X'X) b = X'y
This minimizes the sum of squared residuals
The calculator builds the design matrix with a column of ones for the intercept and the two predictor columns, forms the normal equations and solves the resulting three-by-three system by Gaussian elimination to get the least squares coefficients.
Worked example
Fit y on x1 and x2 for the five default rows, which were generated exactly as y = 2 + 1*x1 + 3*x2.
- Row 1: 2 + 1(1) + 3(1) = 6, matching the data
- Row 4: 2 + 1(3) + 3(2) = 11, matching the data
- Because the data fit the model exactly, least squares recovers it
- Coefficients: b0 = 2.00, b1 = 1.00, b2 = 3.00
These are the calculator's default inputs, so the coefficients above match the widget exactly.
Multiple Regression Calculator: frequently asked questions
What is ordinary least squares?
Ordinary least squares is the standard method for fitting a linear model. It chooses the coefficients that minimize the sum of the squared differences between the observed responses and the values predicted by the model.
What do the slope coefficients mean?
Each slope is the estimated change in the response for a one-unit increase in that predictor, holding the other predictor fixed. The intercept is the predicted response when both predictors are zero.
How many data points are needed?
With two predictors and an intercept you need at least three rows. This calculator uses five rows, which is enough to fit the model and leave residual degrees of freedom.
Why is the default fit exact?
The default response was generated with no noise as 2 plus x1 plus three times x2, so the least squares solution recovers those exact coefficients.
How are the coefficients computed?
By forming and solving the normal equations exactly with Gaussian elimination. The result is the unique least squares estimate for the data you enter.
Official sources
- Regression and least squares reference (NIST/SEMATECH e-Handbook of Statistical Methods): US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.