Before you start
You will be able to
- Interpret each slope of a multiple regression as the change in the fitted value per unit of its predictor, holding the other predictors fixed, with units.
- Explain why a slope changes when a predictor is added or left out, and calculate the change with the omitted-variable formula.
- Calculate adjusted R² and the overall F statistic from R², n and the number of predictors, and say what each tests or measures.
- Read a multiple-regression Summary Output from the ToolPak and the coefficients LINEST returns for several x columns, in their reverse order.
- Evaluate standardised slopes and a time trend left out of the model, and say when each misleads.
Review first
- The least-squares line — The least-squares line, its slope and intercept, and why the criterion is the sum of squared residuals.
- Residuals and R² — R², SST = SSR + SSE and the residual standard error, which carry over unchanged.
- Inference for coefficients — The t test and interval for one slope, read here for each slope in turn.
- Partial correlation — Holding a variable fixed with residuals, and the barista-hours and waits puzzle this lesson turns into a slope.
- Descriptive statistics and regression in Excel — LINEST and the ToolPak Regression tool for one x, which this lesson extends to several.
Fictional case A fictional coffee business founded by Ana Lim. It starts as a catering and barista-training service, opens its own cafés and an online shop for beans, and plans a canned cold brew.
The idea
Fictional case
Ana’s Harbourside manager wants to know what a warm day is worth. The least-squares line of footfall on the day’s high temperature over Harbourside’s 306 days has a slope of 2.02: each extra °F goes with about two more people through the door. But warm days at the waterfront differ in other ways too. The five harbour-festival days all fell in late May, July and August, and on those days the crowds had nothing to do with the thermometer. Ana wants the warm-day figure with those other differences taken out.
One equation, several predictors
A multiple regression predicts y from several predictors at once: . The coefficients are chosen by the same rule as for one predictor, least squares: they make the residual sum of squares, , as small as possible. With two predictors the fitted values lie on a flat plane above the (x₁, x₂) grid rather than on a line; with more, no picture helps, but the arithmetic is the same and software does it.
For Harbourside, Ana fits footfall on four predictors: the day’s high (°F), the day’s rain (inches), a weekend column that is 1 on Saturdays and Sundays and 0 otherwise, and a festival column that is 1 on the five festival days. The table shows the high temperature’s slope as predictors join the model one model at a time.
| Predictors | Slope on high (people per °F) | Slope on rain (people per inch) | R² | Adjusted R² | s (people) |
|---|---|---|---|---|---|
| High | 2.02 | — | 0.190 | 0.188 | 62.5 |
| High, rain | 2.07 | −88.4 | 0.252 | 0.247 | 60.1 |
| High, rain, weekend, festival | 1.66 | −75.8 | 0.922 | 0.921 | 19.5 |
| … and the build-up | 1.44 | −76.1 | 0.944 | 0.944 | 16.5 |
Each row is a separate least-squares fit. s is the residual standard error. The build-up column is explained under “A trend left out” below.
Read the third model’s equation as the line for days that are alike on everything else:
Its slope on the high, 1.66, says that among days with the same rain, the same weekend-or-weekday status and the same festival status, each extra °F goes with about 1.66 more people. The rain slope says that, holding the temperature, the day of the week and festivals fixed, each inch of rain goes with about 76 fewer people. The weekend slope compares a Saturday or Sunday with a weekday of the same weather: about 69 more people. A slope in a multiple regression is a partial slope: it answers its question only for days that match on the other predictors.
Why the slope changed
The high temperature’s slope moved from 2.02 to 2.07 when rain joined, then fell to 1.66 when the weekend and festival columns joined. The festival days explain most of it: their highs were 77–84°F against an average of 63.9°F on the other days, and their crowds were about 330 people above a normal day. With temperature alone in the model, the line has to account for those hot, packed days, so it tilts up: part of the festival effect is credited to the weather. Fitting high and festival alone gives a slope of 1.55. The weekend column changes the slope hardly at all, because Saturdays are no warmer than Wednesdays.
This is omitted-variable bias: a slope estimated without a predictor that both affects y and goes with the included x absorbs part of that predictor’s effect. It is the regression version of a confounding variable, and it is the same thing the partial-correlation lesson did with residuals. A multiple-regression slope can even reverse sign, as the next example shows.
Baristas and waits, as slopes
B05 found that peak barista hours and peak waits correlate at +0.53 over the 612 café-days, but at −0.72 holding transactions fixed. The regression of the peak wait on barista hours alone has a slope of +0.548: days with an extra barista hour had waits about half a minute longer. Add transactions as a second predictor and the slope on barista hours becomes −1.264: on days with the same number of transactions, an extra barista hour goes with a peak wait about 1.26 minutes shorter. The t statistic for that slope is −25.95 on 609 degrees of freedom, exactly the t of B05’s partial correlation; the two methods ask the same question and share one test.
The omitted-variable formula shows where the +0.548 came from. Let be the slope of the omitted predictor (transactions) on the included one (barista hours): 23.72 transactions per barista hour, because managers roster more baristas on busier days. Then the short regression’s slope is the long one’s plus the omitted predictor’s slope times :
The identity is exact for least squares, not an approximation. Barista hours look harmful alone because they carry the busy-day effect of transactions with them. The case’s generator planted this: waits depend on transactions per barista hour, and managers roster from the trade they expect. The waits rise along a curve rather than a line (B05 found the steep rise beyond about seven transactions per barista hour), so −1.264 is an average slope; the transformations-and-influence lesson fits the curve.
In depth
The model
The population model behind a multiple regression is , with errors that average zero at every combination of the x’s. The fitted coefficients estimate the ’s. There are coefficients counting the intercept, and the residual standard error is , in y’s units (the standard error of the regression). The conditions for the t tests and intervals are those of the inference-for-coefficients lesson, applied to the model as a whole; the assumptions-and-diagnostics lesson checks them.
The model is additive: each predictor’s slope is the same whatever the values of the others. On a weekend and on a weekday the high temperature is assumed to add the same 1.66 people per °F. When that is false (the cafés respond differently to the weekend, for example) the model needs an interaction term, which the next lesson adds.
A partial slope is a slope of residuals
There is a concrete way to see “holding the others fixed”. Regress y on all the other predictors and keep the residuals; regress on the same predictors and keep its residuals. The least-squares slope of the first set of residuals on the second is exactly from the multiple regression (a result known as the Frisch–Waugh–Lovell theorem). The residuals of are the part of the other predictors can’t predict, so is estimated only from that part. B05’s partial correlation is the correlation of the same two sets of residuals; the partial slope is their slope, in y’s units per unit of .
This explains a practical rule. A slope can be estimated well only if its predictor varies once the others are held fixed. If a predictor is almost a copy of the others, its residuals are tiny and its slope is poorly determined: that is multicollinearity, the subject of the multicollinearity-and-model-choice lesson.
Omitted-variable bias
Suppose the true model contains and , and you fit alone. The short slope is , where is the slope of on . Two conditions make the bias: must matter for y () and it must go with (). Its direction is the sign of : festivals add footfall and go with warm days, so leaving them out pushes the temperature slope up. Leaving out something unrelated to the included predictors, like the weekend column for the temperature slope, costs precision (a larger s) but causes no bias.
Not every extra predictor reduces bias. Adding a variable that lies on the path from x to y (a mediator, in B05’s terms) removes part of the effect you want; adding one caused by both x and y (a collider) creates a false link. The choice of predictors is a judgement about how the business works, which the multicollinearity-and-model-choice lesson takes further.
A trend left out
New cafés take time to find their customers. The generator planted a build-up: each café’s trade starts at 72% of its eventual level on 1 March and reaches 100% after four months. The weather follows the season, and March and April were both cold and quiet; so a model without the build-up credits some of the build-up to temperature. The third model’s residuals show it: they average −21.5 people in March and −13.8 in April, and +9.5 to +11.4 from October to December. The model over-predicts the early months and under-predicts the late ones.
The fourth model adds a build-up column that rises evenly from 0 on 1 March to 1 on 29 June and stays at 1, the shape the generator used. Its slope, 35.5 people, is the build-up’s size; the temperature slope falls to 1.44, and the monthly residual averages shrink to within ±4 people. The planted effect is multiplicative, so it differs from day to day: from about 0.4 people per °F on a wet weekday in March to about 5 on a festival day. Fitting the fourth model to the generator’s planted mean footfall for each day gives a temperature slope of 1.47 people per °F, the average effect the linear slope estimates; the fourth model recovers it and the third overstates it by about 13%. With real data no one tells you the trend’s shape. A straight-line “day” column is the wrong shape here: R² rises, but the temperature slope moves further from the truth, to 1.79; plotting residuals in time order, as the assumptions-and-diagnostics lesson does, is how you find out what is missing.
R² and adjusted R²
R² keeps its meaning, the share of the variation in y around its mean that the fitted values account for: . It can never fall when a predictor is added, because least squares can always set the new slope to zero and do no worse. So R² rewards adding anything, even a column of random numbers. Adjusted R-squared charges for each coefficient:
For the third model, . Adjusted R² rises when a new predictor’s t statistic is larger than 1 in size and falls otherwise, so it can go down. It is a rough guard against padding a model, not a test, and it is not a share of anything: it can even be negative. The next lesson but one compares models more carefully.
The overall F test
Each slope’s t test asks whether that predictor adds anything, holding the others fixed. The overall F test asks whether the predictors together add anything at all: . Its statistic compares the variation explained per predictor with the residual variation per degree of freedom:
on k and n − p degrees of freedom. For the third model, on 4 and 301 df, and the p-value (Significance F in Excel) is far below 0.001. With one predictor F is the slope’s t squared; with several it is a single test of all of them. The two kinds of test can disagree: when two predictors carry the same information, F can be large while neither t is, because the data show that something matters but can’t say which. The general F test that compares any two nested models is in the multicollinearity-and-model-choice lesson.
Reading the output in Excel
The ToolPak’s Regression tool takes an Input X Range of several adjacent columns and prints the same three blocks as for one predictor: Regression Statistics (Multiple R, R Square, Adjusted R Square, Standard Error, Observations), the ANOVA table (Regression, Residual and Total rows with df, SS, MS, F and Significance F) and one row of coefficients per predictor with its standard error, t Stat, P-value and 95% limits. The Explore widget prints it for any set of Harbourside’s predictors.
LINEST accepts several x columns too, but returns the coefficients in reverse order: for x’s in columns C, D and E, =LINEST(B2:B31,C2:E31) spills across one row (Microsoft’s documentation states the order as mn, mn−1, …, m1, b). To pick out the slope on column C, take the third entry: =INDEX(LINEST(B2:B31,C2:E31),1,3). With stats set to TRUE, row 2 holds the standard errors in the same order, row 3 R² and s, row 4 F and the residual df, and row 5 SSR and SSE. TREND with several x columns predicts from the fitted equation: =TREND(B2:B31,C2:E31,G2:I2) for a new day whose x values are in G2:I2.
Standardised slopes, with care
Slopes come in their predictors’ units (people per °F, per inch, per festival), so their sizes can’t be compared directly. A standardised slope rescales each to standard deviations, : the change in y, in SDs of y, per SD of . For the fourth model they are 0.31 for the high, −0.21 for rain, 0.45 for the weekend, 0.61 for the festival and 0.16 for the build-up.
They are easy to over-read. A 0/1 column’s SD depends on how common the 1s are, not on any “typical change”: the festival column’s SD is only 0.13 because festivals are rare, and its 0.61 means 330 people times that small SD. Rain’s SD is inflated by a few wet days, since most days are dry. And standardising uses this sample’s spreads, so the same effect gets a different standardised slope in a sample with a narrower range. Use them to describe one sample, not to rank causes.
Formulas
Fitted multiple regression
- Fitted value of y for a rowunits of y
- Intercept: the fitted value when every x is 0units of y
- Partial slope: change in the fitted value per unit of x_j, the other x’s held fixedunits of y per unit of x_j
- The j-th predictorits units
- Number of predictors
Assumes. The coefficients minimise the sum of squared residuals; each predictor’s effect is the same at every value of the others (additive).
p = k + 1 coefficients count the intercept. LINEST returns b_k, …, b_1, b_0 in that order.
Adjusted R²
- Adjusted R²
- Share of the variation in y around its mean accounted for, 1 − SSE/SST
- Number of rows
- Number of coefficients, counting the intercept (k + 1)
Rises when a new predictor’s |t| exceeds 1, falls otherwise; can be negative. Not a test.
Overall F test of a multiple regression
- Test statistic for H₀: every slope is 0
- Regression sum of squares, Σ(ŷ − ȳ)²units of y squared
- Residual sum of squares, Σ(y − ŷ)²units of y squared
- SSR ÷ SST
- Number of predictors
- Number of rows
- Number of coefficients, k + 1
Assumes. The model’s conditions (independent rows, constant spread, roughly normal errors).
Excel: F.DIST.RT(F, k, n − p) is Significance F.
Omitted-variable formula
- Slope on x₁ when x₂ is left outunits of y per unit of x₁
- Slopes on x₁ and x₂ when both are inunits of y per unit of x₁; of x₂
- Slope of the least-squares line of x₂ on x₁units of x₂ per unit of x₁
Assumes. Exact for least-squares fits on the same rows (with any other predictors in both models, δ comes from regressing x₂ on all the included predictors).
Bias is zero if x₂ doesn’t matter (b₂ = 0) or doesn’t go with x₁ (δ = 0); its sign is that of b₂δ.
Standardised slope
- Standardised slope: SDs of y per SD of x_j
- The slope in its own unitsunits of y per unit of x_j
- Sample standard deviations of x_j and of yunits of x_j; of y
Depends on this sample’s spreads; misleading for 0/1 and skewed predictors.
Worked examples
Fictional figures
Ferrowick Bike Hire (fictional) fits daily rentals on the day’s high (°F), the hours of rain and a weekend column (1 on Saturdays and Sundays) over one summer: rentals = 12 + 2.5 × high − 18 × rain hours + 40 × weekend. A simple regression of rentals on the high alone had a slope of 3.1. Interpret the three slopes, predict rentals for a 70°F Saturday with 2 hours of rain, and explain why the temperature slope is smaller here than in the simple regression.
- Read each slope with the others held fixed. High: among days with the same rain and the same weekend status, each extra °F goes with 2.5 more rentals. Rain: holding the temperature and the day fixed, each hour of rain goes with 18 fewer. Weekend: a Saturday or Sunday has 40 more rentals than a weekday with the same weather.
- Substitute: rentals.
- Compare slopes with the omitted-variable rule. The simple slope, 3.1, also carries rain’s effect (and possibly the weekend’s) if warm days were drier: rain lowers rentals (b₂ < 0) and goes down as temperature goes up (δ < 0), so b₂δ is positive and the short slope is pushed up.
Answer. About 191 rentals. The multiple-regression slope on the high, 2.5 rentals per °F, compares days with the same rain and day of the week; the simple slope of 3.1 also credits the temperature with warm days’ drier weather, and with any weekend crowds if warm days fell more often at weekends.
What it means. If the manager staffs from the temperature forecast alone, she should use the simple slope only if she has no rain forecast; with both forecasts, the multiple regression keeps rain’s effect from being counted twice.
Fictional figures
Over both cafés’ 612 days, the peak wait regressed on peak barista hours alone has a slope of +0.548 minutes per barista hour. With transactions added, the slopes are −1.264 on barista hours and 0.0764 minutes per transaction. Transactions regressed on barista hours have a slope of 23.72. Show how the short slope arises from the long one, say what each answers, and explain what the second model still can’t claim.
- Apply the omitted-variable formula with x₁ = barista hours and x₂ = transactions: . It reproduces the short slope exactly.
- Name the parts. b₂ > 0: more transactions go with longer waits. δ > 0: managers roster more barista hours on busier days. Their product, +1.81 minutes per barista hour, is the busy-day effect that the short regression credits to the baristas.
- Read each slope. The short slope answers “on days with an extra barista hour, how much longer were waits?” (half a minute, because they were busy days). The long slope answers “on days with the same transactions, how did waits differ per extra barista hour?” (about 1.26 minutes shorter).
- Link to B05: the long model’s t for barista hours is −25.95 on 609 df, the same as the t test of the partial correlation −0.725. Both are the same comparison of equally busy days.
- State the limits. The rows are both cafés on the same days, so they aren’t independent, and the t is too large; waits rise along a curve in the load, so −1.264 averages a small effect on quiet days and a large one on busy days; and the log is observational.
Answer. The +0.548 is −1.264 (the barista-hours slope at a given number of transactions) plus 0.0764 × 23.72 = 1.812 (the busy-day effect carried by barista hours). Holding transactions fixed, each extra barista hour goes with a peak wait about 1.26 minutes shorter.
What it means. For a roster decision Ana needs the long slope, because she wants to compare a day with and without an extra barista at the same trade. The planted mechanism agrees with its sign. Its size should be treated as rough until the curve is modelled and the dependence between rows is allowed for.
Fictional figures
Harbourside’s manager sees a forecast of 82°F and no rain for a Saturday in July, against a cool Saturday of 68°F (July Saturdays averaged 81.4°F). Using the fourth model (high, rain, weekend, festival and the build-up, which is complete by July), how many more people should she expect, and roughly how many more transactions? Which model should she not use, and why?
- The fourth model’s fitted values for a dry, non-festival Saturday after the build-up: , so the difference between two such days depends only on the high: people.
- The fitted values themselves are about 223 people at 82°F and 203 people at 68°F. Their difference is 20.1, as the slope says.
- Over the year Harbourside turned 46.9% of its visitors into transactions (total transactions ÷ total footfall), so 20 more visitors mean roughly more transactions.
- Don’t use the one-predictor slope (2.02 per °F) or the third model (1.66 per °F). Both overstate the weather’s effect because they credit it with festival crowds or with the early months’ build-up, and would suggest 28 or 23 extra people.
Answer. About 20 more people (223 against 203) and roughly 9 more transactions, using the slope of 1.44 people per °F from the model with the build-up.
What it means. Twenty more visitors over the whole day is not a reason for a second barista at the peak; a festival (about 330 more people) is. How uncertain a single day’s footfall is around those fitted values is the prediction-and-intervals lesson’s question, and the answer is wider than 20 people.
Explore
Common mistakes
“The slope on temperature is the effect of one more degree.”
It is the difference in fitted footfall per °F between days alike on the other predictors in this model. Leave out the build-up and it becomes 1.66; leave out everything but temperature and it becomes 2.02. A coefficient is an association with the others held fixed; it becomes an effect only with an argument that nothing important is left out.
“Adding a predictor can only make the other slopes more accurate.”
It removes omitted-variable bias only when the new predictor is a confounder. A mediator (on the path from x to y) or a collider (affected by both) makes the slope answer a different question or creates a link that isn’t there. Choose predictors from how the business works.
“R² went up, so the new predictor belongs in the model.”
R² can’t go down when a predictor is added, whatever it is. Adjusted R² charges for each coefficient, and the t test asks whether the predictor adds anything given the others. Neither replaces judgement about what the model is for.
“The first coefficient LINEST returns belongs to the first x column.”
With several x columns LINEST returns them in reverse order: the last column’s slope first and the intercept last. INDEX(LINEST(…),1,k + 1 − j) is the slope on the j-th of k columns. The ToolPak prints them in the original order with their names, which is why it is easier to read.
“The largest standardised slope is the most important predictor.”
Standardised slopes depend on the sample’s spreads, and for 0/1 or skewed predictors the SD isn’t a meaningful change. Harbourside’s festival column has the largest standardised slope, but only five days in the year. Compare slopes in their own units against changes that are realistic for the decision.
“The p-values are tiny, so the slopes are certain.”
The standard errors assume independent rows. Neighbouring days share the season and the cafés share their weather, so the standard errors are too small; a time trend left out (the build-up) makes residuals run in streaks. Check the residuals in time order before trusting the third decimal place.
Guided practice
Work through these with hints when you need them. Every hint and every worked solution is there to be used.
Loading four questions…
On your own
No hints this time. Answer, check, and read the feedback; the solution appears once you have answered or if you ask for it. Your first answers count toward mastery.
Loading six questions…
In practice
Multiple regression is the everyday tool for “what goes with what, other things equal”. A retailer estimates how much a promotion adds to a store’s weekly sales holding the store’s size, the season and local holidays fixed. A hotel asks how much an extra night of advance booking is worth at the same room type and day of the week. An energy supplier models daily demand on temperature, the day of the week and public holidays, because each of those changes demand and they go together through the year. In each case the analyst’s main work is choosing what to hold fixed and checking what was left out; the arithmetic is the easy part.
Fictional case
Ana’s note to the Harbourside manager: “Over 2027, each extra °F went with about 1.4 more people through the door, comparing days with the same rain, day of the week and festival status, after allowing for the café’s first four months of build-up (model with five predictors, R² = 0.94, s = 16 people). The simple line through footfall and temperature gives 2.0 per °F, because it also credits the weather with the festival crowds and with the quiet, cold spring when the café was new. Rain costs about 76 people per inch and a weekend adds about 69. These are associations in observational data, and the standard errors are somewhat too small because neighbouring days are alike.”
Her note does what a good regression report does. It gives the slope with its units and with the list of what was held fixed. It sets the multiple-regression slope beside the simple one and explains the gap in terms of the business, not the algebra. It reports the fit (R² and s) so the reader knows how much the model leaves unexplained, and it flags what could make the standard errors misleading. It doesn’t rank the predictors by standardised slopes or claim that warm weather “drives” 1.4 extra people; it says what the data show for days that were alike.
The same habits carry into the rest of the module. The categorical-predictors-and-interactions lesson lets the weekend’s effect differ between the two cafés, which pooling them hides. The multicollinearity-and-model-choice lesson asks what happens when two predictors carry nearly the same information, such as footfall and transactions, and how to choose between models with more and fewer terms without fooling yourself.
Knowledge check
Six questions, one attempt each, no hints. Score 80% or more to complete the lesson; you can take it again at any time.
Loading six questions…
Summary
- A multiple regression ŷ = b₀ + b₁x₁ + … + b_kx_k is fitted by least squares; each slope is the change in ŷ per unit of its predictor, holding the other predictors fixed.
- A partial slope equals the slope of y’s residuals on x_j’s residuals after both are regressed on the other predictors: the same idea as B05’s partial correlation, in y’s units.
- Leaving out a predictor that matters and goes with an included one biases its slope: b̃₁ = b₁ + b₂δ, exactly. Barista hours’ slope on waits is +0.548 alone and −1.264 holding transactions fixed.
- A time trend can be the omitted predictor: without the build-up, Harbourside’s temperature slope is 1.66 people per °F; with it, 1.44, close to the planted average of 1.47.
- R² never falls when a predictor is added; adjusted R² = 1 − (1 − R²)(n − 1)/(n − p) charges for each coefficient.
- The overall F test, F = (R²/k) ÷ ((1 − R²)/(n − p)) on k and n − p df, tests whether all the slopes are zero; each t test asks about one slope given the others.
- LINEST returns several slopes in reverse order; the ToolPak prints them in order with their names. Standardised slopes describe one sample and mislead for 0/1 or skewed predictors.
Key formulas
- Fitted multiple regression
- Adjusted R²
- Overall F test of a multiple regression
- Omitted-variable formula
- Standardised slope
Terms introduced
- Multiple regression
- A least-squares model that predicts y from two or more predictors at once, ŷ = b₀ + b₁x₁ + … + b_kx_k.
- Partial slope
- A slope in a multiple regression: the change in the fitted value of y per unit of one predictor, holding the other predictors in the model fixed. Also called a partial regression coefficient.
- Omitted-variable bias
- The change in a slope caused by leaving out a predictor that affects y and goes with the included predictor; for least squares the short slope is b₁ + b₂δ, δ being the slope of the omitted predictor on the included one.
- Adjusted R-squared
- R² adjusted for the number of coefficients, 1 − (1 − R²)(n − 1)/(n − p). It falls when a predictor adds too little, and can be negative.
- Overall F test
- The test of a regression model’s null hypothesis that every slope is zero, F = (SSR/k) ÷ (SSE/(n − p)) on k and n − p degrees of freedom; Significance F in Excel’s output.
- Standardised slope
- A slope rescaled to standard-deviation units, b_j × s(x_j) ÷ s(y): the change in y, in SDs, per SD of the predictor in the sample.
Sources
- Holmes, A., Illowsky, B. & Dean, S. Introductory Business Statistics 2e, section 13.4, “The Regression Equation” (multiple regression, adjusted R², the F test). OpenStax. openstax.org/books/introductory-business-statistics-2e/pages…
- Penn State Eberly College of Science. STAT 462: Applied Regression Analysis, Lesson 5, “Multiple Linear Regression (MLR) Model & Evaluation”. online.stat.psu.edu/stat462/node/83
- Penn State Eberly College of Science. STAT 462: Applied Regression Analysis, “The general linear F-test”. online.stat.psu.edu/stat462/node/135
- Microsoft Support. “LINEST function”. support.microsoft.com/en-US/excel/functions/linest-function
