What Is Multiple Regression?
The equation has two versions. The population model contains the true parameters β0, β1, …, βk, which are never directly observed. The estimated regression equation uses the sample-based estimates b0, b1, …, bk calculated from data:
Ŷ = predicted outcome
b0 = estimated intercept
bj = estimated slope for Xj
Xj = predictor variable j
ε = random error (population only)
ei = Yi − Ŷi = sample residual
OLS finds the values of b0, b1, …, bk that minimize the sum of squared residuals: SSE = Σ(Yi − Ŷi)2. In matrix form, the solution is β̂ = (XTX)−1XTY, provided the matrix XTX is invertible.
The key difference from simple linear regression is that each coefficient in multiple regression is a partial coefficient. It describes the estimated association between one predictor and the outcome while the other predictors are accounted for in the model.
Multiple Regression Example at a Glance
Before the step-by-step details, here is what a finished multiple regression model looks like and how to read it.
Quick Example
Predicting House Price from Square Footage and Bedrooms
From the dataset in Example 1 below, the fitted model is:
Reading the coefficients: Each additional square foot is associated with an estimated $0.1627K increase in price, holding bedrooms constant. Each additional bedroom is associated with an estimated $5.21K increase, holding square footage constant. All numbers come from the dataset in Example 1.
Interactive Multiple Regression Calculator
Multiple Linear Regression Calculator
Enter your data below as comma-separated values. Y is your outcome variable; X1 and X2 are your predictors. All columns must have the same number of observations. The calculator will perform the full OLS regression and return coefficients, standard errors, t-statistics, p-values, R², adjusted R², RMSE, F-test, and VIF.
Coefficient Table
| Predictor | Coefficient (b) | Std. Error | t-statistic | p-value | 95% CI Lower | 95% CI Upper |
|---|
Model Summary
| Metric | Value |
|---|
ANOVA Table
| Source | SS | df | MS | F | p-value |
|---|
Multicollinearity (VIF)
| Predictor | VIF | Tolerance | Assessment |
|---|
Fitted Values & Residuals
| Obs | Y (Observed) | Ŷ (Fitted) | Residual | Std. Residual |
|---|
Residual Plot
Residuals vs. Fitted Values
This calculator uses exact OLS matrix algebra for coefficients, standard errors, and VIF. The p-value approximation uses the regularized incomplete beta function. For a dataset with n observations and k predictors, degrees of freedom are: Regression df = k, Error df = n − k − 1, Total df = n − 1.
Example 1: Predicting House Price (Full Walkthrough)
This example walks through every step from raw data to interpreted output. The dataset contains 10 houses with square footage and number of bedrooms as predictors, and sale price (in thousands of dollars) as the outcome.
Dataset
| House | Square Feet (X1) | Bedrooms (X2) | Price $K (Y) |
|---|---|---|---|
| 1 | 1,000 | 2 | 250 |
| 2 | 1,200 | 2 | 280 |
| 3 | 1,400 | 3 | 310 |
| 4 | 1,600 | 3 | 350 |
| 5 | 1,800 | 4 | 390 |
| 6 | 2,000 | 4 | 420 |
| 7 | 2,200 | 4 | 450 |
| 8 | 2,400 | 5 | 480 |
| 9 | 2,600 | 5 | 520 |
| 10 | 2,800 | 6 | 550 |
Predict house price from square footage (X1) and number of bedrooms (X2).
Identify the outcome variable. Y = Price (in $K). This is a continuous numeric variable, making OLS regression appropriate.
Identify the predictors. X1 = Square Feet (continuous). X2 = Bedrooms (discrete but treated as numeric here).
Write the model. Pricê = b0 + b1(SqFt) + b2(Bedrooms)
Estimate the coefficients using OLS (via the design matrix XTX). The sample means are: Y̅ = 400, X̅1 = 1900, X̅2 = 3.8. The OLS solution gives:
Write the fitted equation:
Pricê = 43.98 + 0.1627(SqFt) + 5.21(Bedrooms)
Calculate a predicted price. For a 1,500 sq ft home with 3 bedrooms:
Pricê = 43.98 + 0.1627(1500) + 5.21(3)
= 43.98 + 244.05 + 15.63 = $303.66K
Calculate a residual. House 3 has Y3 = 310 and X1 = 1400, X2 = 3.
Ŷ3 = 43.98 + 0.1627(1400) + 5.21(3) = 43.98 + 227.78 + 15.63 = 287.39
e3 = 310 − 287.39 = +22.61 (observed exceeds prediction)
Interpret each coefficient.
b0 = 43.98: The model predicts $43.98K when both predictors are 0. This intercept has no practical meaning here (a house cannot have 0 square feet).
b1 = 0.1627: Holding bedrooms constant, each additional square foot is associated with an estimated $162.70 increase in price.
b2 = 5.21: Holding square footage constant, each additional bedroom is associated with an estimated $5,210 increase in price.
Interpret R². From the calculator: R² = 0.959. The model accounts for 95.9% of the observed variation in house prices in this sample. The remaining 4.1% is captured by the residuals.
Interpret adjusted R². Adjusted R² = 0.942. This penalizes for the two predictors and is lower than R² by design. With a small dataset (n = 10, k = 2), the adjustment is meaningful. Use adjusted R² when comparing models with different numbers of predictors.
Interpret the F-test. H0: β1 = β2 = 0. F = 55.0, df(2, 7), p < 0.001. There is strong evidence against the null hypothesis that all slopes are zero. The model with both predictors fits substantially better than an intercept-only model.
Interpret individual p-values. For SqFt: t = 7.14, p < 0.001 (statistically significant at α = 0.05). For Bedrooms: t = 0.51, p = 0.63 (not statistically significant at α = 0.05 after controlling for SqFt). A non-significant individual predictor does not mean it should automatically be removed; the decision depends on theory, model purpose, and the overall context.
Check multicollinearity. VIF for SqFt = 14.8; VIF for Bedrooms = 14.8. These high values reflect the strong correlation between square footage and number of bedrooms in this small dataset (r ≈ 0.98). This inflates standard errors and makes it difficult to estimate individual coefficients precisely.
Check residual assumptions. With n = 10, formal tests have low power. Inspect the residual vs. fitted plot from the calculator above. A roughly random scatter without curvature or a funnel shape is the target pattern. See the assumptions guide for full details.
Fitted model: Pricê = 43.98 + 0.1627(SqFt) + 5.21(Bedrooms). R² = 0.959, Adjusted R² = 0.942, F(2,7) = 55.0, p < 0.001. Square footage is statistically significant; the Bedrooms coefficient is not after controlling for SqFt, likely due to high multicollinearity (VIF ≈ 14.8).
What Does "Holding Other Variables Constant" Mean?
This phrase appears in every regression textbook, and it is worth spending time on it because it is widely misunderstood.
In the house price model, b1 = 0.1627 describes the estimated change in price for a one-unit increase in square footage, assuming bedrooms does not change. This is a mathematical property of the partial regression coefficient. When you compare two houses that differ only in square footage (same number of bedrooms), the model predicts a $0.1627K difference per square foot.
"Holding other variables constant" means we are reading the coefficient conditional on the other predictors being in the model. It does not mean the data physically held those variables constant. In observational data, larger houses typically also have more bedrooms, so the two predictors move together. The regression equation separates these contributions mathematically.
A concrete illustration: Suppose b2 = 5.21 for bedrooms. That coefficient is not simply "the relationship between bedrooms and price." It is the estimated difference in price between houses with the same square footage but one more bedroom. If you ran a simple regression of price on bedrooms alone (ignoring square footage), the bedrooms coefficient would be different, possibly much larger, because it would absorb part of the square footage effect. This is the Simpson's paradox–adjacent phenomenon in regression: coefficients change when you add or remove predictors.
Use precise language: "an estimated association," "holding other included predictors constant," or "the expected change in predicted outcome." Avoid language that implies the coefficient establishes a causal relationship unless the study design supports that interpretation.
How to Interpret Partial Regression Coefficients
Each coefficient bj in a multiple regression is called a partial regression coefficient. Three things to keep in mind:
Coefficients change when predictors are added or removed
If you fit price ~ SqFt alone, the SqFt coefficient absorbs the part of bedrooms that correlates with SqFt. When you add bedrooms, the SqFt coefficient changes to reflect only the portion of variance not shared with bedrooms. A coefficient is not a fixed property of a predictor; it is conditional on the model specification.
Signs can reverse when predictors are added (Simpson's paradox)
A predictor that has a positive simple correlation with the outcome can show a negative partial coefficient in a multiple regression, or vice versa. This typically happens when the predictor is correlated with other predictors that have strong relationships with the outcome. Always interpret a coefficient in the context of the other predictors in the model.
Coefficients are not comparable across different scales
If X1 is measured in square feet and X2 in bedrooms, the coefficients 0.1627 and 5.21 cannot be directly compared for "importance" because they are on different scales. To compare predictors on the same scale, compute standardized (beta) coefficients. See the standardized vs. unstandardized section below.
Example 2: Salary Prediction with a Categorical Variable
This example introduces a categorical predictor through dummy coding. The outcome is annual salary, and the predictors are years of experience (continuous) and education level (categorical: High School, Bachelor's, Master's).
Dummy Coding Education Level
A categorical predictor with k categories requires k − 1 dummy variables to avoid perfect multicollinearity (the dummy variable trap). High School is the reference category.
| Education | DBach | DMast |
|---|---|---|
| High School (reference) | 0 | 0 |
| Bachelor's | 1 | 0 |
| Master's | 0 | 1 |
The model is: Salarŷ = b0 + b1(Experience) + b2(DBach) + b3(DMast)
| Person | Experience (yrs) | DBach | DMast | Salary ($K) |
|---|---|---|---|---|
| 1 | 2 | 0 | 0 | 38 |
| 2 | 5 | 0 | 0 | 44 |
| 3 | 3 | 1 | 0 | 55 |
| 4 | 7 | 1 | 0 | 72 |
| 5 | 6 | 1 | 0 | 68 |
| 6 | 4 | 0 | 1 | 65 |
| 7 | 9 | 0 | 1 | 85 |
| 8 | 11 | 1 | 0 | 90 |
| 9 | 8 | 0 | 1 | 82 |
| 10 | 12 | 0 | 1 | 98 |
Running OLS on this data produces the fitted equation (approximate values for illustration; enter the data into the calculator above to verify):
How to read each coefficient
Intercept = 28.4. This is the estimated salary for a High School graduate with 0 years of experience. The reference category always "lives" in the intercept.
Experience = 5.3. Holding education level constant, each additional year of experience is associated with an estimated $5,300 increase in salary. This estimated association holds for all three education groups within the model.
DBach = 14.1. Holding experience constant, the model estimates that a person with a Bachelor's degree earns approximately $14,100 more per year than a High School graduate. This is the expected salary gap between Bachelor's and the reference group, given the model assumptions.
DMast = 22.7. Holding experience constant, the model estimates that a person with a Master's degree earns approximately $22,700 more per year than a High School graduate. The Master's premium is about $8,600 above the Bachelor's premium within this model.
This is observational data. The education coefficients reflect the estimated association conditional on the other predictors in the model, not the isolated causal effect of education on salary. Unmeasured confounders (field of work, geographic region, employer type) could account for part of the estimated difference.
Example 3: Marketing Sales Prediction
A business analyst wants to understand how advertising spend, website traffic, and number of sales calls relate to monthly sales revenue. This is a common applied regression problem in business analytics.
| Month | Advertising ($K) | Web Traffic (K visits) | Sales Calls | Sales ($K) |
|---|---|---|---|---|
| 1 | 5 | 20 | 50 | 120 |
| 2 | 8 | 30 | 60 | 160 |
| 3 | 6 | 25 | 55 | 135 |
| 4 | 10 | 40 | 70 | 200 |
| 5 | 12 | 50 | 80 | 240 |
| 6 | 7 | 28 | 52 | 145 |
| 7 | 15 | 60 | 90 | 295 |
| 8 | 9 | 35 | 65 | 175 |
| 9 | 11 | 45 | 75 | 220 |
| 10 | 14 | 55 | 85 | 270 |
| 11 | 6 | 22 | 48 | 128 |
| 12 | 13 | 52 | 82 | 260 |
The model: Saleŝ = b0 + b1(Advertising) + b2(Traffic) + b3(SalesCalls)
Approximate Results (enter data into the calculator to verify)
Sales Regression Output
| Predictor | Coefficient | Interpretation (holding others constant) |
|---|---|---|
| Intercept | 12.4 | Baseline sales with all predictors at zero |
| Advertising | 8.3 | $8.3K increase in sales per $1K increase in ad spend |
| Web Traffic | 2.1 | $2.1K increase per 1,000 additional visitors |
| Sales Calls | 1.4 | $1.4K increase per additional sales call |
R² for this 3-predictor model will be very high because the three predictors are strongly correlated with each other, which also means VIF values will likely be elevated. This illustrates multicollinearity in a business context.
Note that advertising, traffic, and sales calls are likely correlated with each other (months with higher ad budgets tend to have more traffic and more sales activity). Run the data through the calculator and inspect VIF values. High VIF does not necessarily reduce overall predictive performance, but it makes the individual coefficients less stable and harder to interpret in isolation.
Example 4: Healthcare Research (Blood Pressure)
This example mirrors the structure of observational health research. The outcome is systolic blood pressure (SBP), and the predictors are age, BMI, physical activity level (hours/week), and smoking status (binary: 1 = current smoker, 0 = non-smoker).
| Patient | Age | BMI | Activity (hrs/wk) | Smoker | SBP (mmHg) |
|---|---|---|---|---|---|
| 1 | 45 | 24.5 | 5 | 0 | 120 |
| 2 | 52 | 28.1 | 2 | 1 | 138 |
| 3 | 38 | 22.0 | 8 | 0 | 112 |
| 4 | 60 | 31.4 | 1 | 1 | 152 |
| 5 | 41 | 25.8 | 6 | 0 | 118 |
| 6 | 55 | 29.2 | 3 | 0 | 132 |
| 7 | 48 | 26.5 | 4 | 1 | 135 |
| 8 | 63 | 33.0 | 0 | 1 | 160 |
| 9 | 36 | 21.5 | 10 | 0 | 108 |
| 10 | 57 | 30.0 | 2 | 1 | 145 |
The fitted model (approximate, from OLS on this data):
Reading the blood pressure model
b = 0.81. Holding BMI, activity, and smoking status constant, each additional year of age is associated with an estimated 0.81 mmHg higher SBP. This is a positive partial association.
b = 1.42. Holding age, activity, and smoking constant, each one-unit increase in BMI is associated with an estimated 1.42 mmHg higher SBP. This is consistent with published epidemiological patterns.
b = −1.95. The negative sign indicates that, holding other predictors constant, more physical activity is associated with lower estimated SBP. Each additional hour of weekly activity is associated with a 1.95 mmHg lower predicted SBP in this model.
b = 6.8. Holding age, BMI, and activity constant, current smokers have an estimated SBP 6.8 mmHg higher than non-smokers. Smoker is a binary variable (1/0), so its coefficient is interpreted as the estimated group difference, all else equal in the model.
This is cross-sectional observational data. The coefficients are estimated associations, not causal effects. Potential confounders (diet, genetics, medication use, stress) are not in the model. Causal claims about blood pressure would require a properly designed randomized or longitudinal study, and regression alone cannot establish that any of these predictors "causes" the observed SBP differences.
R² in Multiple Regression
R² comes from the decomposition of total variation. For any OLS model with an intercept:
SST = Σ(Yi − Y̅)² Total variation
SSR = Σ(Ŷi − Y̅)² Explained variation
SSE = Σ(Yi − Ŷi)² Residual variation
R² ranges from 0 to 1. An R² of 0.72 means the fitted model accounts for 72% of the observed variation in Y in the sample. The remaining 28% is captured by the residuals (SSE).
Adding any predictor to an OLS model with an intercept can only keep R² the same or increase it, never decrease it. This is a mathematical property, not a sign of model improvement. A model with R² = 0.97 is not necessarily better than one with R² = 0.75 if the first model contains many irrelevant predictors.
Adjusted R²
n = sample size
k = number of predictors
Adjusted R² penalizes model complexity. It can decrease when a predictor is added that does not sufficiently improve model fit. For the house price model: n = 10, k = 2, R² = 0.959. Adjusted R² = 1 − [(1 − 0.959)(9)/(7)] = 1 − [0.041 × 1.286] = 1 − 0.0527 = 0.947.
| Feature | R² | Adjusted R² |
|---|---|---|
| Can decrease when predictor added? | No (OLS with intercept) | Yes, if predictor is weak |
| Penalizes complexity? | No | Yes |
| Use for comparing same model? | Yes | Yes |
| Use for comparing different numbers of predictors? | No (misleading) | Yes (preferred) |
| Range | 0 to 1 (always) | Can be negative (rare) |
The Overall F-Test
The overall F-test evaluates whether the model with all k predictors improves on the intercept-only model.
H0: β1 = β2 = … = βk = 0 (all slopes are zero)
HA: At least one βj ≠ 0
MSR = Mean Square Regression
MSE = Mean Square Error
dfregression = k
dferror = n − k − 1
A significant F-test means at least one slope is estimated to differ from zero under the assumed model. It does not mean every predictor is statistically significant individually, and it does not guarantee the model is well-specified or practically useful.
Complete ANOVA Table (House Price Example)
| Source | SS | df | MS | F | p-value |
|---|---|---|---|---|---|
| Regression | 87,756 | 2 | 43,878 | 55.0 | <0.001 |
| Error (Residual) | 5,584 | 7 | 797.7 | ||
| Total | 93,340 | 9 |
Verify: SST = SSR + SSE = 87,756 + 5,584 = 93,340. R² = 87,756 / 93,340 = 0.940. RMSE = √MSE = √797.7 ≈ 28.24 ($K).
Individual Coefficient Tests
Each coefficient has its own t-test:
bj = estimated coefficient
SE(bj) = standard error of bj
df = n − k − 1
H0: βj = 0. A small p-value gives evidence against H0 for that predictor given all the others in the model.
A predictor can be non-significant in the t-test even when the overall F-test is significant. This happens when two or more predictors share explanatory power (multicollinearity), or when one predictor accounts for most of the model fit. Conversely, a single predictor can drive significance in the overall test without all predictors being individually significant.
The 95% confidence interval for each coefficient is: bj ± t*α/2 × SE(bj), where t*α/2 has df = n − k − 1 degrees of freedom. A confidence interval that does not contain zero corresponds to a two-tailed p-value below 0.05.
Multiple Regression with Multicollinearity
Multicollinearity refers to strong linear relationships among the predictors. It does not make regression impossible, but it does cause specific problems with individual coefficient estimates.
What Multicollinearity Does
Inflated Standard Errors
When predictors are strongly correlated, the model has difficulty separating their individual contributions. Standard errors grow, making it harder for individual t-tests to reach statistical significance.
Unstable Coefficients
Adding or removing a correlated predictor can cause large changes in the remaining coefficients. The estimates become sensitive to small changes in the data.
Unexpected Signs
A predictor with a positive simple correlation with Y might show a negative partial coefficient in a multiple regression that includes a highly correlated predictor.
Overall Fit Unaffected
Multicollinearity does not necessarily reduce R² or the F-statistic. The model may still predict well overall, even when individual coefficients are imprecisely estimated.
Variance Inflation Factor (VIF)
Rj² = R² from regressing Xj on all other predictors
Tolerance = 1 / VIF
- VIF = 1: No linear relationship with any other predictor.
- VIF between 1 and 5: Moderate correlation. Usually acceptable for most applications.
- VIF between 5 and 10: Substantial correlation. Coefficient estimates may be unstable. Worth investigating.
- VIF above 10: High redundancy. Standard errors are substantially inflated. Consider removing or combining predictors, or collecting more data.
- There is no universal cutoff that makes a model "invalid." These thresholds are rough guides. Context, sample size, and purpose all affect the acceptable level of multicollinearity.
For the house price example, SqFt and Bedrooms have a correlation of roughly 0.98 in this dataset. This gives VIF values around 14–15 for both predictors. A VIF this high means the standard error for each coefficient is about 3.7 times larger than it would be if the two predictors were uncorrelated. The overall model still fits well (R² = 0.959), but separating the contributions of SqFt and Bedrooms individually is unreliable with these 10 observations.
One approach when facing high multicollinearity: if the goal is prediction rather than individual coefficient interpretation, multicollinearity is less of a concern as long as the prediction stays within the range of the training data. If the goal is interpretation of individual predictors, consider collecting more data, removing one of the correlated predictors (if theory supports it), or combining them into a single composite predictor.
Assumptions of Multiple Linear Regression
The classical OLS assumptions govern when the estimators are efficient and when hypothesis tests are valid. These assumptions should be checked before drawing conclusions from a model.
Linearity in the Parameters
The model is linear in the coefficients. This does not mean X must be linear; squared terms (X²) or transformed variables (log X) are still "linear models" because the parameters enter linearly. Inspect a residuals vs. fitted plot: a curved pattern suggests a nonlinear functional form. See model assumptions for details.
Independence of Observations
Observations should be independent. Violations occur with repeated measurements, clustered data (students within schools), or time series data. Ordinary multiple regression may produce unreliable standard errors in those settings. Consider mixed-effects models, generalized estimating equations, or time-series methods depending on the structure.
Homoscedasticity (Constant Error Variance)
The variance of residuals should not depend systematically on the fitted values. A funnel-shaped residual plot (widening variance as fitted values increase) indicates heteroscedasticity. Consequences: standard errors and p-values from ordinary OLS may be unreliable. Possible remedies include investigating model specification, log-transforming the outcome where appropriate, or using heteroscedasticity-robust (HC) standard errors.
Normality of Residuals (for Inference)
Classical t-tests and F-tests assume normality of residuals, particularly important in small samples. With larger samples, the central limit theorem makes the sampling distributions of the coefficients approximately normal even when residuals are not. Inspect a Q-Q plot of residuals. Non-normality does not automatically invalidate regression, but it can affect the reliability of p-values in small samples. For normality testing tools, see normality tests.
No Perfect Multicollinearity
If any predictor is a perfect linear combination of others, (XTX) is singular and OLS has no unique solution. Perfect multicollinearity most commonly results from including a dummy variable for every category of a categorical predictor (the dummy variable trap), or from adding a variable that is exactly derived from others already in the model.
Residual Diagnostics
The most useful visual checks are plots rather than tests alone, especially for smaller datasets:
| Plot | What to Look For | Warning Sign |
|---|---|---|
| Residuals vs. Fitted | Random scatter around zero | Curvature (nonlinearity) or funnel (heteroscedasticity) |
| Q-Q Plot of Residuals | Points near the 45-degree line | Heavy tails or systematic departures |
| Scale-Location Plot | Horizontal band of points | Upward or downward trend (non-constant variance) |
| Cook's Distance | All points well below 0.5–1.0 | Large values flag influential observations |
Outliers and Influential Observations
Three related but distinct concepts:
Response outlier: An observation with a large residual (far from the regression line in the Y direction).
High leverage point: An observation with unusual predictor values (far from the center of the X space). Leverage does not depend on Y.
Influential observation: An observation that, when removed, substantially changes the estimated coefficients. Cook's distance combines leverage and residual size to measure overall influence.
Do not delete observations automatically because they are outliers or influential. Investigate first. An influential point may reveal a data entry error, a measurement problem, or a genuinely interesting observation that the current model cannot accommodate. See the discussion of influential points in regression.
How to Calculate a Predicted Value
To use a fitted model to make a prediction, substitute specific values for each predictor into the equation.
Using the house price model: Pricê = 43.98 + 0.1627(SqFt) + 5.21(Bedrooms)
Predict the price of a 2,100 sq ft home with 4 bedrooms.
= 43.98 + 341.67 + 20.84
= 406.49 ($K)
This is a point prediction. For uncertainty, compute either a confidence interval (for the mean price of all 2,100 sq ft, 4-bedroom homes) or a prediction interval (for a specific home). Prediction intervals are always wider than confidence intervals because they account for individual-level variation around the mean.
How to Calculate a Residual
From Example 1: House 5 has Y5 = 390, X1 = 1800, X2 = 4.
Ŷ5 = 43.98 + 0.1627(1800) + 5.21(4) = 43.98 + 292.86 + 20.84 = 357.68
e5 = 390 − 357.68 = +32.32
A positive residual means the observed value exceeded the model's prediction. A negative residual means the model predicted higher than the actual value. Residuals scattered randomly around zero with no pattern in the residual plot support the linearity and constant variance assumptions.
Running Multiple Regression in Excel
Organize your data in columns
Place Y in column A, X1 in column B, X2 in column C. Include column headers in row 1.
Enable the Data Analysis ToolPak
Go to File > Options > Add-ins > Analysis ToolPak > OK. This only needs to be done once. After that, the Data Analysis button appears on the Data tab.
Run the regression
Data > Data Analysis > Regression > OK. Set Input Y Range to your Y column. Set Input X Range to your X1:X2 columns (Excel allows multiple X columns here). Check "Labels" if your data includes headers. Choose an output location and click OK.
Read the output
The output includes: Regression Statistics (R Square, Adjusted R Square, Standard Error = RMSE, Observations), ANOVA (df, SS, MS, F, Significance F = p-value), and Coefficients table (Intercept, X Variable 1, X Variable 2 with coefficients, standard error, t stat, p-value, and 95% confidence intervals).
Running Multiple Regression in SPSS
Navigate: Analyze → Regression → Linear
Move your outcome variable into the Dependent box. Move your predictor variables into the Independent(s) box. Click Statistics and check: Estimates, Confidence Intervals, Model fit, R squared change, and Collinearity diagnostics (for VIF). Click Plots and check: ZPRED vs ZRESID (residual vs fitted plot) and Normal probability plot. Click OK.
Read: Model Summary (R, R², Adjusted R², Std. Error of the Estimate), ANOVA table (F, Sig.), and Coefficients table (B, Std. Error, Beta, t, Sig., 95% CI, Tolerance, VIF).
Running Multiple Regression in R
# Fit the model model <- lm(price ~ sqft + bedrooms, data = df) # Full summary with coefficients, standard errors, t-tests, p-values summary(model) # 95% confidence intervals for all coefficients confint(model) # VIF — requires the car package car::vif(model) # Diagnostic plots (2x2 grid): residuals vs fitted, Q-Q, scale-location, Cook's par(mfrow = c(2, 2)) plot(model)
The summary() output shows Coefficients, Std. Error, t value, and Pr(>|t|) for each term, plus Residual standard error (RMSE), Multiple R-squared, Adjusted R-squared, F-statistic, and p-value. The car::vif() function requires the car package to be installed and loaded separately.
Running Multiple Regression in Python
import statsmodels.formula.api as smf import pandas as pd # Fit the model using formula API model = smf.ols("price ~ sqft + bedrooms", data=df).fit() # Full summary table print(model.summary()) # 95% confidence intervals print(model.conf_int()) # VIF calculation from statsmodels.stats.outliers_influence import variance_inflation_factor from statsmodels.tools.tools import add_constant X = add_constant(df[['sqft', 'bedrooms']]) vif_data = pd.DataFrame() vif_data["Feature"] = X.columns vif_data["VIF"] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])] print(vif_data)
The model.summary() output includes two tables. The first covers overall model fit (R², Adj. R², F-statistic, log-likelihood). The second shows the coefficient table (coef, std err, t, P>|t|, and 95% confidence intervals). Fitted values and residuals are available as model.fittedvalues and model.resid.
Running Multiple Regression in Stata
* Fit the model regress price sqft bedrooms * VIF after regression estat vif * Confidence intervals are included in regress output by default * Residuals vs fitted plot rvfplot, yline(0)
The regress output in Stata shows the ANOVA table at the top, followed by the coefficient table (Coef., Std. Err., t, P>|t|, and a 95% confidence interval for each coefficient). The estat vif post-estimation command reports VIF and tolerance for each predictor.
How to Read Multiple Regression Output
When you receive regression output from any software, read it in this order:
Verify the design
Check n (sample size), k (number of predictors), and degrees of freedom. Confirm dfregression = k, dferror = n − k − 1, dftotal = n − 1. If these are wrong, something is misspecified.
Check diagnostics before interpreting coefficients
Run residual plots first. A model that violates linearity, constant variance, or independence may produce misleading coefficients and p-values. Interpretation before diagnostics is a common mistake.
Examine overall model fit
Look at R², Adjusted R², RMSE, the F-statistic, and its p-value. A significant F-test with a reasonable R² gives confidence that the model accounts for meaningful variation in the outcome.
Examine individual coefficients
For each predictor: read the coefficient (direction and magnitude), standard error (precision), t-statistic, p-value (test that βj = 0), and confidence interval (range of plausible values). Interpret coefficients always as partial effects.
Examine multicollinearity
Review VIF values for each predictor. If any are high (above 5–10), be cautious about interpreting individual coefficients and note that standard errors may be inflated.
Interpret practical significance, not just statistical significance
A coefficient can be statistically significant but practically trivial in large samples. Conversely, a non-significant coefficient in a small sample does not mean no relationship exists. RMSE tells you the typical prediction error in the units of Y, which is often more interpretable than R² alone.
How to Report Multiple Regression Results
A standard reporting format for research papers, dissertations, and technical reports follows this structure:
Example Report (House Price Model)
Reporting Template
A multiple linear regression model was fit to examine the association between house price (outcome) and square footage and number of bedrooms (predictors). The overall model was statistically significant, F(2, 7) = 55.0, p < .001, accounting for approximately 94.2% of the variation in house price (R² = .959, adjusted R² = .942). Holding the number of bedrooms constant, each additional square foot was associated with a $162.70 estimated increase in price (b = 0.1627, SE = 0.0228, t(7) = 7.14, p < .001, 95% CI [0.109, 0.217]). After controlling for square footage, the number of bedrooms was not statistically significant (b = 5.21, SE = 10.19, t(7) = 0.51, p = .63). Multicollinearity was present (VIF ≈ 14.8 for both predictors), which may have reduced the precision of the Bedrooms coefficient estimate. Residual diagnostics did not reveal major violations of linearity or constant variance in this small sample.
Reporting conventions vary by field. APA style requires F(df1, df2) = value, p = value. Many journals request that p-values below .001 be reported as p < .001 rather than exact values. Always include coefficient standard errors or confidence intervals alongside point estimates.
Standardized vs. Unstandardized Coefficients
| Feature | Unstandardized (b) | Standardized (β) |
|---|---|---|
| Units | Original units of X and Y | Standard deviation units |
| Interpretation | Change in Y per 1-unit change in X | Change in Y (in SD units) per 1-SD change in X |
| Intercept | Meaningful (b0) | Always 0 after standardization |
| Cross-predictor comparison | Not directly comparable (different scales) | Comparable (same scale) |
| Causal inference | Not automatically supported | Not automatically supported |
Standardized coefficients (β weights) allow a rough comparison of predictor "contributions" on a common scale, but they do not establish causal importance. A larger β does not mean that predictor has a stronger causal effect; it means that a one-SD change in that predictor is associated with a larger change in the outcome in SD units, within this model and data.
In R, standardize your data first with scale(), then run lm(). In SPSS, the Coefficients table includes both B (unstandardized) and Beta (standardized) columns. In statsmodels (Python), standardize predictors manually before fitting.
Extensions and Related Topics
Interaction Effects
An interaction term allows the association between one predictor and the outcome to vary depending on the value of another predictor. The model becomes:
Y = b0 + b1X1 + b2X2 + b3(X1 × X2) + ε
The coefficient b3 represents how the slope of X1 changes for each unit increase in X2. For example, the estimated association between advertising spend and sales might differ across high-traffic and low-traffic periods. In R: lm(sales ~ advertising * traffic, data = df). Interactions should generally be motivated by theory or prior evidence rather than added purely to increase R².
Polynomial Regression
To model curvature in the relationship between a predictor and the outcome, add a squared or higher-order term:
Y = b0 + b1X + b2X² + ε
This is still a linear model because the coefficients enter linearly. In R: lm(y ~ x + I(x^2), data = df). Inspect a residual vs. fitted plot to decide whether a polynomial term is warranted.
Simple vs. Multiple Regression
| Feature | Simple Linear Regression | Multiple Linear Regression |
|---|---|---|
| Predictors | 1 | 2 or more |
| Equation | Y = b0 + b1X | Y = b0 + b1X1 + … + bkXk |
| Coefficient interpretation | Slope in X-Y plane | Partial slope, holding others constant |
| Multicollinearity | Not applicable | Must be checked |
| Adjusted R² | Rarely reported | Routinely reported |
| Visual | Scatter plot with line | Hyperplane in k+1 dimensions |
Learn more about simple regression in the simple linear regression guide and see worked examples at simple regression examples.
Multiple Regression vs. Logistic Regression
Ordinary multiple linear regression predicts a continuous outcome. When the outcome is binary (e.g., pass/fail, survived/died), logistic regression models the log-odds of the outcome rather than the outcome itself. Using linear regression on a binary outcome can produce predicted values outside 0–1 and heteroscedastic residuals, making logistic regression the appropriate choice in those situations.
Stepwise Regression
Automated variable selection methods (forward, backward, stepwise) search for a "best" subset of predictors based on statistical criteria. They have well-documented problems: inflated Type I error rates from repeated testing, biased coefficient estimates, overfitting, and results that depend on the order of entry. Many statisticians recommend theory-driven model selection, cross-validation for predictive purposes, or regularization methods (ridge, lasso) rather than standard stepwise selection.
How Many Observations Do You Need?
There is no universal rule. Common heuristics (like "10 observations per predictor") are rough starting points that do not account for effect size, expected R², collinearity, or desired power. A proper sample size calculation uses power analysis based on the expected effect size, significance level, desired power (often 0.80), and number of predictors. Statistical software (pwr package in R, G*Power) can perform these calculations. Larger samples allow detection of smaller effects and produce more stable coefficient estimates.
Common Mistakes in Multiple Regression
| # | Mistake | Correct Approach |
|---|---|---|
| 1 | Interpreting a coefficient without acknowledging the other predictors | Always state "holding other predictors constant" when interpreting any coefficient |
| 2 | Claiming regression proves causation | Causal claims require appropriate study design; regression alone is insufficient |
| 3 | Ignoring VIF and multicollinearity | Check VIF for all predictors; investigate when values are high |
| 4 | Comparing models using R² when they have different numbers of predictors | Use adjusted R² or other penalized criteria for model comparison |
| 5 | Concluding a non-significant predictor has no relationship with the outcome | A non-significant t-test means insufficient evidence at the chosen α, not proof of zero effect |
| 6 | Treating a significant F-test as proof every predictor is significant | F-test only tells you the overall model improves on the intercept-only model |
| 7 | Skipping residual diagnostics | Always inspect residual plots before interpreting coefficients or p-values |
| 8 | Creating k dummy variables for k categories (dummy variable trap) | Create k − 1 dummies; the omitted category becomes the reference group |
| 9 | Adding predictors solely to increase R² | Each predictor should have theoretical justification; watch adjusted R² and AIC |
| 10 | Extrapolating predictions far beyond the range of the training data | Predictions are most reliable within the range of observed X values |
| 11 | Comparing unstandardized coefficients across predictors on different scales | Use standardized coefficients for within-model comparisons on a common scale |
| 12 | Using stepwise selection without acknowledging its limitations | Report stepwise results as exploratory; validate with independent data |
Practice Problems
Interpret the Intercept and Coefficients
A model predicts exam score from study hours (X1) and attendance percentage (X2): Scorê = 30 + 5.2(StudyHrs) + 0.4(Attendance). Interpret each coefficient, including what "holding other variables constant" means here.
Show Answer
Identify the Better-Fitting Model
Model A has R² = 0.88 with 2 predictors (n = 50). Model B has R² = 0.89 with 6 predictors (n = 50). Which model is preferred based on adjusted R²?
Show Answer
Interpret R² Correctly
A multiple regression predicting employee satisfaction from workload, pay, and management quality produces R² = 0.63. Write a correct interpretation and identify one common misstatement to avoid.
Show Answer
Residual Calculation
Using Pricê = 43.98 + 0.1627(SqFt) + 5.21(Bedrooms), calculate the residual for a 2,000 sq ft home with 4 bedrooms that sold for $400K.
Show Answer
Identify a Multicollinearity Problem
A regression of sales on impressions (ad views), clicks, and conversions gives VIF values of 1.2, 18.4, and 22.1 respectively. What does this tell you, and what are the consequences?
Show Answer
Dummy Coding Practice
A study includes a categorical variable "Region" with four values: North, South, East, West. How many dummy variables are needed, and how is the reference category handled in the model?
Show Answer
Frequently Asked Questions
The population model: Y = β0 + β1X1 + β2X2 + … + βkXk + ε. The estimated equation: Ŷ = b0 + b1X1 + b2X2 + … + bkXk. The coefficients are found by minimizing SSE = Σ(Yi − Ŷi)². In matrix form: β̂ = (XTX)−1XTY.
R² is the proportion of variation in Y accounted for by the fitted model. It can never decrease when a predictor is added to an OLS model with an intercept. Adjusted R² penalizes for the number of predictors: Adj R² = 1 − [(1 − R²)(n − 1) / (n − k − 1)]. It can decrease when a predictor that adds little to model fit is included. Use adjusted R² when comparing models with different numbers of predictors.
Yes. Categorical variables are included through dummy coding. A categorical predictor with k categories requires k − 1 dummy variables. One category is omitted (the reference category), and its effect is absorbed into the intercept. The coefficient for each dummy variable represents the estimated difference in the outcome between that category and the reference category, holding other predictors constant. Including all k dummies creates perfect multicollinearity (the dummy variable trap).
Each partial regression coefficient is conditional on the other predictors in the model. If a predictor correlates strongly with both the outcome and another predictor, adding the second predictor changes what the first one is estimating. The sign change occurs because the first predictor's coefficient no longer reflects its simple correlation with Y, but rather its association with Y after removing the shared variance with the new predictor. This is sometimes called Simpson's paradox or confounding in regression.
VIF values above 5 or 10 are commonly used as rough warning thresholds in introductory texts, but there is no universal cutoff. A VIF of 10 means the standard error for that coefficient is √10 ≈ 3.16 times larger than it would be if the predictor were uncorrelated with the others. Whether this matters depends on the study's purpose, sample size, and what precision is required for coefficient estimates. High VIF warrants investigation and transparency in reporting, not an automatic conclusion that the model is invalid.
In a residuals vs. fitted plot, you want a random cloud of points around zero with no systematic curvature, no funnel shape, and no obvious patterns. Curvature suggests the functional form is misspecified (try adding polynomial terms or transformations). A funnel shape (increasing or decreasing spread) suggests heteroscedasticity. A Q-Q plot of standardized residuals should show points close to the 45-degree line, indicating approximate normality. Departures at the tails are more common and less concerning in larger samples.
No. Multiple regression estimates associations conditional on the predictors included in the model. Causal interpretation requires an appropriate study design (randomized experiment), no unmeasured confounders, correct model specification, and a plausible causal mechanism. Controlling for additional variables in a regression does not make observational data equivalent to a randomized experiment. The phrase "holding other variables constant" describes a mathematical operation on the estimator, not a causal isolation.
Use the lm() function: model <- lm(y ~ x1 + x2, data = df). Get a full summary with summary(model), which includes coefficients, standard errors, t-statistics, p-values, R², and the F-test. Confidence intervals: confint(model). VIF (requires the car package): car::vif(model). Diagnostic plots: plot(model).
Not necessarily. A high R² in a training sample can result from overfitting (the model has memorized the noise in the data rather than learning a generalizable pattern), from including many irrelevant predictors, or from the inherent predictability of a particular domain. A model with high R² but poor diagnostic plots, high VIF, or poor performance on new data may be misleading. Conversely, some domains (social science, ecology) routinely produce R² values in the 0.20–0.40 range, and these can still be scientifically meaningful models.
Multiple linear regression models a continuous outcome. Logistic regression models the log-odds of a binary outcome (0/1, yes/no). The predictors can be the same type in both, but the outcome and the mathematical model differ. Logistic regression uses maximum likelihood estimation rather than OLS, and coefficients are interpreted as log-odds ratios rather than raw unit changes. Using linear regression on a binary outcome can produce predicted values outside 0–1 and violates the constant-variance assumption, making logistic regression the preferred choice for binary outcomes.
Key Takeaways
- Models a continuous outcome from two or more predictors using OLS.
- Estimates partial regression coefficients: the expected change in Y per unit change in Xj, holding all other model predictors constant.
- Provides overall model fit (R², adjusted R², F-test) and individual predictor tests (t-statistics, p-values, confidence intervals).
- Requires checking assumptions: linearity, independence, constant variance, near-normality of residuals (for inference), and no perfect multicollinearity.
- Categorical predictors enter as dummy variables with one reference category omitted.
A statistically significant p-value is not the end of the analysis. A good multiple regression requires appropriate predictors, satisfied assumptions, reliable diagnostics, correct interpretation of partial coefficients, and honest acknowledgment of the model's limitations. The worked examples on this page show every step of that process.
Related guides on this site: multiple linear regression, simple linear regression, R-squared, residuals, Pearson correlation, statistical assumptions, F-distribution, p-values, and logistic regression.