Statistical Inference for EveryoneXYZ Homework Edition

⇩ Download ▾

10.3 Multiple regression

In order to control for a variable that may be affecting our result, we simply expand our linear model, including slopes (also called coefficients) for each of the different variables. Once we do this, visualization becomes challenging because we move into three or more dimensions. Instead of mm for the slope, the multiple slopes are typically labeled with the greek letter β\beta and numbered, such as β1,β2,\beta_{1}, \beta_{2}, etc... The intercept is then labeled β0\beta_{0}. The model structure, however, is the same, and can be written

y = β 0 + β 1 x 1 + β 2 x 2 \begin{eqnarray*} y=\beta_{0}+ \beta_{1}x_{1}+\beta_{2}x_{2} \cdots \end{eqnarray*}

where the different x1x_{1}, x2x_{2}, etc... denote different variables. For the example of the SAT scores, we might have

t o t a l = β 0 + β 1 · e x p e n d i t u r e + β 2 · p e r c e n t _ t a k i n g \begin{eqnarray*} {\rm total} &=& \beta_{0} + \beta_{1}\cdot{\rm expenditure} + \beta_{2}\cdot{\rm percenttaking} \end{eqnarray*}

where percent_taking\rm percenttaking is a variable representing the percent of students taking the exam. Including this variable gives the posterior distributions shown in Figure 10.8. Notice that the effect of expenditure is both statistically significant and positive. We can interpret the values in the following way.

Have we controlled for all of the effects? Perhaps not! This is where the ingenuity and expertise of the person analyzing the problem comes into play.

Three stacked posterior curves from the two-variable SAT model: the expenditure coefficient centered at 12.29 (entirely positive, 1%-99% from 2.11 to 22.46), the percent-taking coefficient centered at -2.85 (entirely negative, -3.37 to -2.33), and the intercept centered at 993.83 (941.25 to 1046.41).
Figure 10.8. The posterior distributions for coefficients on the expenditure term, the percent taking term, and the intercept.

Adapted from Statistical Inference for Everyone, by Brian Blais (Bryant University), licensed under CC BY-SA 4.0 (dual-licensed under the GNU FDL 1.2 or later; this adaptation uses the CC BY-SA grant). Changes were made; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.