Regression & correlation
Multiple Regression Calculator
Fit several predictors at once, with each coefficient adjusted for the others.
Have a spreadsheet? Drop a CSV here
Or . CSV, TSV or plain text. You pick which column is which after it loads — the names in your file do not have to match ours. The file is read in your browser and never uploaded.
How to read this result
Each coefficient is an effect holding the others fixed. That is a different quantity from the simple relationship between that predictor and y — and when predictors are correlated with each other, the two can have opposite signs. Reading a multiple-regression coefficient as if it were a simple slope is the most common misinterpretation of this model.
The F test asks whether the model as a whole beats nothing. Individual t tests ask about each predictor given the others. It is entirely possible for F to be significant while no single coefficient is, which happens when correlated predictors share the credit.
Use adjusted R² to compare models. Plain R² rises every time you add a column, including columns of noise.
Correlated predictors inflate the standard errors. The coefficients stay unbiased but become unstable: they swing between similar data sets and can flip sign. If two predictors measure nearly the same thing, the model cannot tell which one matters, and the wide interval is it telling you so.
The formula
- the intercept
- the change in y per unit of xⱼ, holding the other predictors constant
- the design matrix, with a column of ones for the intercept
Solved by Gaussian elimination on the normal equations. Perfectly collinear predictors make the matrix singular, which the calculator reports rather than returning nonsense.
Worked example
Two predictors of the same outcome
Twelve observations with two predictors. Both are related to y, and to each other — which is the situation multiple regression exists to handle.
Columns: x₁, x₂, y — 1 2 5.1 / 2 1 4.2 / 3 4 9.3 / 4 3 8.1 / 5 6 13.2 / 6 5 12.4 / 7 8 17.5 / 8 7 16.1 / 9 10 21.4 / 10 9 20.2 / 11 12 25.1 / 12 11 24.6
- Build the design matrix with a column of ones for the intercept.X is 12 × 3
- Solve the normal equations.b = (XᵀX)⁻¹Xᵀy
- Which gives the three coefficients.b₀ = 1.646, b₁ = 0.509, b₂ = 1.509
- Each standard error comes from the diagonal of (XᵀX)⁻¹ times the residual variance.SE(b₁) = 0.0513 → t = 9.93
- The model's overall F, on 2 and 9 degrees of freedom.F = 9269.7, p < 10⁻¹⁴
Both coefficients are significant here because the two predictors, while correlated, are not redundant. Make x₂ an exact multiple of x₁ and the model becomes unidentifiable — the calculator says so rather than returning arbitrary numbers.
Checked against R's lm(y ~ x1 + x2).
The calculator above is loaded with these numbers by the Load the worked example button.
Assumptions, and when to use something else
Everything simple regression assumes — linearity, independent errors, constant variance, roughly normal residuals — plus two of its own:
- No perfect collinearity. One predictor must not be an exact linear combination of the others. Near-collinearity is legal and damaging: it inflates standard errors and destabilises coefficients.
- Enough observations per predictor. The common rules of thumb are 10 to 20 per predictor. Below that the model fits noise, and R² becomes meaningless — with k = n − 1 predictors it is 1 by construction.
- You have one predictorLinear regressionSimpler output, plus prediction intervals.
- The outcome is yes/noLogistic regressionA binary outcome needs a model that cannot predict below 0 or above 1.
- You want to compare group means insteadOne-way ANOVAFor a categorical predictor with several levels, ANOVA is the same model in different clothes.
Questions people ask
How many predictors can I use?
As many as the data support. The arithmetic needs more observations than predictors; the statistics needs considerably more — 10 to 20 observations per predictor is the usual guidance. Beyond that you are fitting noise.
What is multicollinearity and why does it matter?
Predictors that are strongly correlated with each other. The model cannot tell which one is responsible, so their coefficients become unstable — large standard errors, wild swings between samples, sometimes a sign flip. Predictions stay fine; interpretation does not.
Why is my model significant but no coefficient is?
Classic collinearity. The predictors jointly explain the outcome, but each one adds little once the others are in the model, so every individual t test comes back non-significant while the overall F is decisive.
Should I use R² or adjusted R² to compare models?
Adjusted R², always, when the models have different numbers of predictors. Plain R² rises whenever you add a column and so always prefers the bigger model.