Multiple Regression
Most outputs depend on several inputs at once. Multiple regression fits by least squares, and each coefficient is the effect of its input with the others held still. When the inputs tend to move together, that can look nothing like what a one-variable plot suggests.
What the symbols mean
- Partial slope of x₁
Change in the mean response per unit of x₁ with x₂ held fixed.
- Partial slope of x₂
Change per unit of x₂ with x₁ held fixed.
- Design matrix
One row [1, x₁, x₂] per run.
- Coefficient vector
(b₀, b₁, b₂), chosen to minimize the sum of squared residuals.
What the symbols mean
- Cross-product of the predictors
Σ(x₁ − x̄₁)(x₂ − x̄₂): zero when the inputs vary independently, as in a designed experiment.
- Cross-product with the response
Σ(x₁ − x̄₁)(y − ȳ); S₂y is the same with x₂.
What the symbols mean
- Interaction coefficient
How much the slope in x₁ changes per unit of x₂: ∂ŷ/∂x₁ = b₁ + b₁₂x₂.
- Adjusted R²
R² with a penalty for each coefficient. It falls when a useless predictor is added.
- Number of coefficients
Including the intercept: 3 for b₀ + b₁x₁ + b₂x₂.
Explanation
Multiple regression is simply fitting a "line" that uses two or more inputs at once to predict an output, like weld strength from both current and weld time. The equation is a straight-line fit with an extra term: (how much changes per unit of , with held fixed) and (the same for ). That "held fixed" is the whole point, and it's what a one-input plot can't give you. The fitting is still least squares, just with a computer doing the algebra.
The scene. Spot welds hold car-body panels together, and their strength depends on the welding current and on the weld time. A plant's records hold both, along with the pull-test strength of coupons. Plot strength against current alone and the trend is weak: 0.2 kN per kA. But in those records, operators who turned the current up also shortened the weld time, to avoid spatter. The shorter times hid part of the current's benefit.
Holding the other fixed. The fitted plane has : slide along with frozen and the response changes by per unit. That's the question an engineer usually asks: if I raise the current and change nothing else, what happens?
Least squares in matrix form. Each run gives a row of the design matrix . Minimizing means the residual vector must be perpendicular to every column of : , the normal equations of least squares and linear models. The first equation says the residuals add to zero, so the plane passes through . Subtracting that point out leaves the 2 × 2 centered system above, small enough to solve by hand.
Why the one-variable slope misleads. Divide the first centered equation by :
Here is the slope of on in the data. The simple slope is the partial slope plus a borrowed piece: times how much moves when does. In the weld records cycles per kA, so the simple slope is . If is large enough the sign even flips (Simpson's paradox). Only when , as in a designed experiment, do simple and partial slopes agree, which is one big reason to design experiments.
Correlated inputs cost precision. Inverting the 2 × 2 system gives
with . When the inputs move together, is near 1 and the data can barely tell their effects apart: the variance is inflated by , the variance inflation factor. For the weld records and the factor is 6. To test a coefficient, compare with on degrees of freedom, as in testing against a spec.
Interactions. Sometimes the effect of one input depends on another: concrete gains strength faster when it cures warm. Add the product term , and then : the slope in changes with . Read such a model carefully. On its own, is the slope in at , which may lie far outside the data.
Adjusted . Adding any predictor, even a column of random numbers, can only lower SSE, so never falls. Adjusted divides each sum of squares by its degrees of freedom, so it rises only when a new term reduces SSE by more than its share.
See it
Worked examples
Eight weld coupons from production records, as (current in kA, weld time in cycles, strength in kN): , , , , , , , . The means are , and , and , , , , . Fit .
- 1
The centered normal equations: and .
Practice
Type your answer and check it. Solve them all to complete the lesson.
In the weld model (current in kA, weld time in cycles, strength in kN), what does the coefficient 0.2 mean?
Use the weld model to predict the strength of a weld made at 10.5 kA for 15 cycles, in kN.
From the weld summary statistics (, ), what slope does a simple regression of strength on weld time alone give, in kN per cycle?
Plant records for a reactor show yield falling 0.7 percentage points per °C of temperature in a simple regression. In the same records operators raised the feed rate by 0.9 units for every °C, and a two-predictor fit gives a feed-rate coefficient of points per unit. What is the effect of temperature with feed rate held fixed, in points per °C?
The two-predictor weld model has and , with . Find its adjusted .
Early-age concrete strength (MPa) is modeled as , with curing time in days and temperature in °C. How much does curing at 25 °C instead of 15 °C add to the strength at 3 days, in MPa?
For the weld model, , , and . Compute the t statistic for , to 2 decimal places, and compare it with (5 degrees of freedom).
The hardest one here. Get it, and you've got this lesson.
Twelve 3D-printed tensile bars from production logs record nozzle temperature (°C), print speed (mm/s) and tensile strength (MPa), with , , , , and . Fit and find , and the adjusted (to 3 decimal places). Enter all three.
Where it's used
Process engineers fit multiple regressions to historical data from welding, molding, machining and chemical plants to find which settings drive quality, and the confounding in those records is the usual reason the findings must be confirmed by a designed experiment. Interaction terms appear wherever physics multiplies effects, from concrete maturity to battery aging, which speeds up with both temperature and state of charge. Adjusted and coefficient t tests decide which terms stay in a model.