Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

Linear Regression and Multiple Regression: Differences, Formula and Worked Example

Simple vs multiple regression on one worked dataset: formulas, slope change, adjusted R², when not to use it, APA reporting and Excel, R, Python code.

Written and maintained by CASRAI Editorial Board

Last updated

Simple linear regression models an outcome from one predictor; multiple regression models it from two or more predictors at once. This guide explains both, shows one dataset fitted both ways with the arithmetic, and covers when not to use either, how to report the result in APA style and how to run it in Excel, R or Python.

Linear regression and multiple regression: definition

Simple linear regression fits a straight line relating one continuous outcome (y) to one predictor (x). Multiple regression extends the same model to k predictors, so each predictor’s coefficient is estimated while the others are held constant. Penn State’s STAT 462 course describes the model as linear in its parameters and the coefficient of each predictor as the change in mean response per unit increase in that predictor when all the other predictors are held constant.

Multiple regression is not the same as multivariate regression. Multiple regression has one outcome and several predictors; multivariate regression has several outcomes modelled together.

Formula and symbols

Simple: y = β₀ + β₁x + ε. Multiple: y = β₀ + β₁x₁ + β₂x₂ + … + βₖxₖ + ε.

  • y: the outcome (response) variable.
  • x₁ … xₖ: the predictors; k is the number of predictors, so the model has k + 1 coefficients including the intercept.
  • β₀: the intercept, the mean response when every predictor equals 0.
  • β₁ … βₖ: the slopes, each the change in mean response per one-unit increase in its predictor, other predictors held constant.
  • ε: the random error; the fitted model’s estimate of it is the residual, eᵢ = yᵢ − ŷᵢ.
  • ŷ: the fitted value predicted by the model.

Coefficients are estimated by ordinary least squares, which chooses the values that minimise the sum of squared residuals (SSE).

Worked example: the same data fitted both ways

Illustrative data, invented for this explanation and not from any study. Eight students: weekly study hours (x₁), average nightly sleep hours (x₂) and exam score (y). Eight observations are used only so the arithmetic is easy to follow; real analyses need far more (see events per variable and minimum sample size for regression).

Student Study hours x₁ Sleep hours x₂ Score y
1 2 5 55
2 3 7 62
3 4 6 63
4 5 7 70
5 6 6 72
6 7 8 80
7 8 7 79
8 9 8 88

Step 1: simple regression of score on study hours

Means: x̄₁ = 5.5, ȳ = 71.125. Sums of squares and cross-products: Sxx = Σ(x₁ − x̄₁)² = 42; Sxy = Σ(x₁ − x̄₁)(y − ȳ) = 184.5; SST = Σ(y − ȳ)² = 836.875.

Slope b₁ = Sxy / Sxx = 184.5 / 42 = 4.393. Intercept b₀ = ȳ − b₁x̄₁ = 71.125 − 4.393 × 5.5 = 46.964. The fitted line is ŷ = 46.96 + 4.39x₁. The residual sum of squares is SSE = 26.393, so R² = 1 − 26.393 / 836.875 = 0.968. Adjusted R² = 1 − (1 − 0.968)(8 − 1)/(8 − 1 − 1) = 0.963.

Step 2: multiple regression adding sleep hours

Solving the least-squares normal equations (b = (XᵀX)⁻¹Xᵀy, done by software for more than one predictor) gives ŷ = 35.14 + 3.668x₁ + 2.342x₂, with SSE = 7.318 on 8 − 2 − 1 = 5 residual degrees of freedom. Then R² = 1 − 7.318 / 836.875 = 0.991 and adjusted R² = 1 − (1 − 0.9913)(7)/(5) = 0.988. Standard errors are 0.274 for x₁ and 0.649 for x₂, so t(5) = 3.668 / 0.274 = 13.38 (p < .001) and t(5) = 2.342 / 0.649 = 3.61 (p = .015). The overall F(2, 5) = [(836.875 − 7.318)/2] / [7.318/5] = 283.38, p < .001.

What changed

Quantity Simple (x₁ only) Multiple (x₁ and x₂)
Slope for study hours 4.39 3.67
R² 0.968 0.991
Adjusted R² 0.963 0.988
Residual SS 26.39 7.32

The study-hours slope fell from 4.39 to 3.67 because study hours and sleep are correlated in these data (r = 0.73): the simple slope was also absorbing part of sleep’s association with score. The multiple-regression slope answers a different question, the score gain per extra study hour among students with the same sleep. Penn State’s STAT 462 notes the same point: correlations among predictors can change slope values dramatically compared with separate simple regressions.

Interpretation: reading the output

Output What it tells you
Intercept (b₀) Mean predicted outcome when all predictors are 0; often outside the observed range, so rarely meaningful alone.
Slope (bⱼ) Change in mean outcome per one-unit increase in that predictor, other predictors held constant.
R² Share of outcome variance explained by the model; it never decreases when a predictor is added.
Adjusted R² R² adjusted for the number of predictors; does not necessarily increase as predictors are added.
t and p for a slope Tests whether that coefficient differs from 0 given the other predictors in the model.
F test Tests whether the predictors together explain more than an intercept-only model.

For a fuller walk-through of the output tables see how to read a regression table and how to interpret R-squared. A high p-value for one predictor does not by itself mean it can be dropped when predictors are correlated.

Assumptions and when not to use linear regression

Linear regression is a poor fit, or needs a different model, in these situations:

  • The relationship is not linear in the parameters. Curved relationships need transformed or polynomial terms; see quadratic regression.
  • The outcome is binary or a count. An ordinary linear model’s constant-variance, normal-error form does not describe it; logistic or count-data models are the usual alternatives.
  • Observations are not independent (repeated measures, clustered or time-series data). Independence between observations is one of the residual checks in the NIST/SEMATECH e-Handbook.
  • Residuals show non-constant variance, drift or clear non-normality. NIST lists these four residual checks: constant variation, no drift, independence and normality.
  • Too many predictors for the sample. NIST notes residual plots become hard to interpret as the number of estimated parameters approaches the number of observations.

Common mistakes: reading a multiple-regression slope as a simple one; treating R² as proof the model is correct; adding predictors until R² rises (use adjusted R² and a justified model); ignoring strongly correlated predictors (see multicollinearity and VIF); and automated variable selection (see why reviewers reject stepwise regression).

How to report it in APA style

A common APA-style pattern reports the overall test, R² and each predictor’s coefficient with its test. For the example above:

A multiple regression predicted exam score from weekly study hours and nightly sleep hours. The model was significant, F(2, 5) = 283.38, p < .001, R² = .99, adjusted R² = .99. Study hours (B = 3.67, SE = 0.27, t(5) = 13.38, p < .001) and sleep hours (B = 2.34, SE = 0.65, t(5) = 3.61, p = .015) were both significant predictors.

Report unstandardised coefficients, their standard errors, the sample size and degrees of freedom, and state which assumption checks you ran. Our APA statistics reporting guide covers the conventions.

How to calculate it in Excel, R or Python

Excel

With hours in A2:A9, sleep in B2:B9 and score in C2:C9. Simple: =SLOPE(C2:C9, A2:A9), =INTERCEPT(C2:C9, A2:A9), =RSQ(C2:C9, A2:A9). Multiple: select a 5-row by 3-column range and enter =LINEST(C2:C9, A2:B9, TRUE, TRUE). LINEST returns coefficients in reverse predictor order (sleep, then hours, then intercept) in the first row, with standard errors in the second row, and R² and the standard error of y in the third.

R

d <- data.frame(hours = c(2,3,4,5,6,7,8,9), sleep = c(5,7,6,7,6,8,7,8), score = c(55,62,63,70,72,80,79,88))
summary(lm(score ~ hours, data = d))           # simple
summary(lm(score ~ hours + sleep, data = d))   # multiple

Python

import pandas as pd, statsmodels.formula.api as smf
d = pd.DataFrame({'hours': [2,3,4,5,6,7,8,9], 'sleep': [5,7,6,7,6,8,7,8], 'score': [55,62,63,70,72,80,79,88]})
print(smf.ols('score ~ hours', data=d).fit().summary())
print(smf.ols('score ~ hours + sleep', data=d).fit().summary())

Both reproduce the coefficients, R² and F values above. For a software-specific walk-through see multiple regression in SPSS; for the wider method family see regression analysis.

FAQ

Can you explain multiple regression in a simple way?

Multiple regression predicts one outcome from several predictors together and tells you each predictor’s contribution after accounting for the others. In the example, sleep and study hours both predict score, and the study-hours slope is the gain per hour among students with equal sleep.

How do I explain linear regression?

It draws the straight line that best fits the points by minimising squared vertical distances. The slope is how much the outcome changes per unit of the predictor; the intercept is the predicted outcome at zero.

When should you not use linear regression?

Avoid it for non-linear relationships, binary or count outcomes, dependent or clustered observations, clearly non-constant residual variance, or when predictors are too many for the sample. See the section above.

What are the three types of regression?

There is no single official list. A common teaching grouping is simple linear, multiple linear and logistic regression, though many others exist (polynomial, count-data, survival and more).

What is the difference between multiple linear regression and multivariate linear regression?

Multiple regression has several predictors and one outcome; multivariate regression has more than one outcome.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Linear Regression and Multiple Regression: Differences, Formula and Worked Example

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →