Quick answer
Multiple linear regression solves β = (XᵀX)⁻¹Xᵀy. With y = 3, 5, 7, 8, 12 and two predictors, the fitted intercept is 0.6167 and the first slope 1.6833, with R² = 0.9768 over 5 observations.
Enter the response values and one or two predictors. The calculator returns the coefficients, R² and the number of observations.
Related tools: Linear Regression Calculator: Least-squares line y = a + bx through paired data. Least Squares Regression Calculator: Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction. Correlation Coefficient Calculator: Pearson correlation of two variables.
How to use the Multiple Linear Regression Calculator
- Type response values (y), for example 3, 5, 7, 8, 12.
- Type predictor 1, for example 1, 2, 3, 4, 5.
- Optionally, type predictor 2 (optional).
- Optionally, type predictor 3 (optional).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Response values (y) | Text, such as 3, 5, 7, 8, 12 | — |
| Predictor 1 | Text, such as 1, 2, 3, 4, 5 | — |
| Predictor 2 (optional) (optional) | Text | — |
| Predictor 3 (optional) (optional) | Text | — |
Formula and method
Formula
β = (XᵀX)⁻¹ Xᵀy; R² = 1 − SSE ÷ SST
IEEE-754 double precision; shown to the decimals indicated.
Ordinary least squares with an intercept, solved from the normal equations; predictors that are exact linear combinations of each other cannot be solved.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Response values (y) = 3, 5, 7, 8, 12; Predictor 1 = 1, 2, 3, 4, 5; Predictor 2 (optional) = 2, 1, 4, 3, 6.
| Result | Value |
|---|---|
| Coefficients (intercept, b₁, b₂ …) | 0.616667, 1.683333, 0.416667 |
| R² | 0.976812 |
| Observations | 5 |
Example 2
Inputs: Response values (y) = 10, 12, 15, 21, 22, 30; Predictor 1 = 1, 2, 3, 4, 5, 6; Predictor 2 (optional) = 5, 3, 6, 2, 8, 4.
| Result | Value |
|---|---|
| Coefficients (intercept, b₁, b₂ …) | 6.691987, 3.96828, -0.481636 |
| R² | 0.971834 |
| Observations | 6 |
Example 3
Inputs: Response values (y) = 2, 4, 5, 4, 5, 8; Predictor 1 = 1, 2, 3, 4, 5, 6.
| Result | Value |
|---|---|
| Coefficients (intercept, b₁, b₂ …) | 1.466667, 0.914286 |
| R² | 0.75665 |
| Observations | 6 |
The first line is the headline result (coefficients (intercept, b₁, b₂ …)). Below it the multiple Linear Regression Calculator lists r² and observations, which describe the same case from other angles. IEEE-754 double precision; shown to the decimals indicated.
Reading it
Each coefficient is the change in y for a one-unit change in that predictor, holding the other fixed. R² of 0.977 says the model explains about 97.7% of the variance, although with only 5 points it overfits easily.
Sample size
There must be more observations than coefficients. Predictors that are highly correlated (multicollinearity) make coefficients unstable. Check residuals and use adjusted R² for comparison.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Response values (y): entering "1, 2" shows "Enter more than 2 observations." beside that field and no result.
- Predictor 1: entering "1, 1, 1, 1" shows "The predictors are linearly dependent, so the fit is not unique." beside that field and no result.
Choosing between the Multiple Linear Regression Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Linear Regression Calculator](/statistics/linear-regression-calculator/) | x values and y values | Regression line |
| [Least Squares Regression Calculator](/statistics/least-squares-regression/) | x values and y values | Regression line |
| [Correlation Coefficient Calculator](/statistics/correlation-coefficient-calculator/) | x values and y values | Correlation r |
| [Covariance Calculator](/statistics/covariance-calculator/) | x values and y values | Sample covariance |
| [R-Squared Calculator](/statistics/r-squared-calculator/) | x values and y values | R² |
Background: regression and correlation
Least squares chooses the line that minimises the sum of the squared vertical distances from the points. The slope is the sum of the cross-products of the deviations divided by the sum of the squared x deviations, and the intercept is the mean of y minus the slope times the mean of x.
For simple regression R² is the square of the correlation coefficient r, the share of the variation in y that the line explains. R² has no sign, so the sign of the slope tells you whether the relationship rises or falls. A strong fit does not prove one variable causes the other.
Assumptions and limitations
- Needs more observations than coefficients
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for response values (y) and predictor 1 to confirm this.
Frequently asked questions
What is R²?
The share of variance explained.
How many observations do I need?
Ten or more per predictor is a common rule.
Can I use categorical predictors?
Only after coding them as numbers, for example a yes/no variable entered as 0 and 1.
What does the Multiple Linear Regression Calculator calculate?
Least-squares coefficients and R² for up to three predictors. It returns Coefficients (intercept, b₁, b₂ …), R² and Observations.
What formula does the Multiple Linear Regression Calculator use?
β = (XᵀX)⁻¹ Xᵀy; R² = 1 − SSE ÷ SST. Ordinary least squares with an intercept, solved from the normal equations; predictors that are exact linear combinations of each other cannot be solved.
What do I need to enter in the multiple Linear Regression Calculator?
You enter Response values (y) and Predictor 1. Optional: Predictor 2 (optional) and Predictor 3 (optional).
How is the result rounded or limited?
IEEE-754 double precision; shown to the decimals indicated. Needs more observations than coefficients.
What is an example of a multiple Linear Regression result?
With response values (y) 3, 5, 7, 8, 12, predictor 1 1, 2, 3, 4, 5 and predictor 2 (optional) 2, 1, 4, 3, 6, the coefficients (intercept, b₁, b₂ …) is 0.616667, 1.683333, 0.416667.
Where does the method come from?
The method follows: Standard ordinary least squares (e.g. Draper & Smith, Applied Regression Analysis).
Related calculators
- Linear Regression Calculator — Least-squares line y = a + bx through paired data.
- Least Squares Regression Calculator — Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction.
- Correlation Coefficient Calculator — Pearson correlation of two variables.
- Covariance Calculator — Sample and population covariance.
- R-Squared Calculator — Coefficient of determination for a simple linear fit.
- Linear Interpolation Calculator — Interpolate a value between two known points.
Sources
- Standard ordinary least squares (e.g. Draper & Smith, Applied Regression Analysis)
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.