Multiple Regression Calculator
Multiple linear regression explains one dependent variable with several predictors at once: ŷ = b₀ + b₁x₁ + … + b_k x_k. Each coefficient gives the average change in the dependent variable produced by a one-unit increase in that predictor while all the other predictors are held constant. This "holding the others constant" reading is what separates multiple regression from simple regression.
This calculator solves the least-squares problem with a numerically stable QR decomposition; it reports a standard error, t, p, and a confidence interval for every coefficient, tests the model as a whole with an F test, and gives R², adjusted R², and the residual standard error. It also computes VIF for multicollinearity and the Durbin-Watson statistic for independence of the residuals, and draws a residual plot and a normal Q-Q plot so you can check the assumptions.
Multiple Linear Regression Formulas
Model: ŷ = b₀ + b₁x₁ + b₂x₂ + … + b_k x_k OLS solution: b = (XᵀX)⁻¹Xᵀy (solved numerically by QR here) Sums of squares: SST = SSR + SSE , SSE = Σ(yᵢ − ŷᵢ)² Determination: R² = 1 − SSE / SST Adjusted: R²_adj = 1 − (1 − R²)·(n − 1)/(n − k − 1) Residual std err: RSE = √[ SSE / (n − k − 1) ] Model test: F = (SSR/k) / (SSE/(n − k − 1)) , df = k , n − k − 1 Coefficient test: t_j = b_j / SE(b_j) , df = n − k − 1 Confidence int.: b_j ± t_(1−α/2) · SE(b_j) Standardized: β_j = b_j · s_xⱼ / s_y Multicollinearity: VIF_j = 1 / (1 − R²_j) Autocorrelation: d = Σ(eₜ − eₜ₋₁)² / Σeₜ²
The solution is built with a Householder QR decomposition rather than the normal equations, which preserves numerical stability when the predictors are measured on very different scales. Assumptions: linearity, independent errors, constant error variance, normally distributed errors, and no perfect multicollinearity.
How to Calculate
- Paste the values of the dependent variable (Y) into the top field.
- In the predictor field, write one variable per line; if you start a line with a name such as "Ads:", that name is used in the tables. Each line must hold as many values as Y.
- Choose the significance level and the confidence level; the coefficient confidence intervals follow the level you pick.
- Look at the model as a whole first: if the F test is not significant, there is no point in interpreting the individual coefficients.
- Read the b, standard error, β, t, p, confidence interval, and VIF columns of the coefficient table together; for variables with a VIF above 10 the coefficient is not trustworthy.
- Inspect the residual plot and the Q-Q plot; if you see a pattern, you need a variable transformation or a different model.
Worked Examples
Effect of advertising and price on sales
For 12 months of data the model comes out as ŷ = 31.855 + 2.801·Reklam (advertising) − 0.521·Fiyat (price). With R² = 0.9979 and F(2, 9) = 2,153.707 (p < 0.001) the model is significant as a whole; the advertising coefficient is significant at p < 0.001 with t = 48.175, while the price coefficient is not (p = 0.346). The VIF values are 1.81, so there is no multicollinearity problem, and Durbin-Watson is 2.296.
Regression equation: ŷ = 31.855 + 2.801·Reklam − 0.521·Fiyat · R² (coefficient of determination): 0.9979 (99.8%) · Adjusted R²: 0.9975
One predictor: the same result as simple regression
A model with study hours as the only predictor gives ŷ = 50.033 + 2.096 × study hours; with R² = 0.4057, adjusted R² = 0.3463, and F(1, 10) = 6.828 (p = 0.026) the slope is significant. The 95% confidence interval for the coefficient is 0.309 – 3.884; these values match simple linear regression exactly, and with one predictor the VIF is 1 by definition.
Regression equation: ŷ = 50.033 + 2.096·Çalışma saati · R² (coefficient of determination): 0.4057 (40.6%) · Adjusted R²: 0.3463
A collinear model (VIF warning)
When two predictors measure the same quantity in different units, the VIF jumps to 41,812.57 and the multicollinearity warning appears. The model looks flawless with R² = 0.9982 and F(2, 7) = 1,985.428 (p < 0.001), yet the individual coefficients turn insignificant at p = 0.480 and p = 0.675: collinear variables mask each other's contribution.
Regression equation: ŷ = -77.029 + 1.596·Boy − 2.381·BoyInc · R² (coefficient of determination): 0.9982 (99.8%) · Adjusted R²: 0.9977