*280*

Multiple linear regression is a method we can use to quantify the relationship between two or more predictor variables and a response variable.

This tutorial explains how to perform multiple linear regression by hand.

**Example: Multiple Linear Regression by Hand**

Suppose we have the following dataset with one response variableÂ *y* and two predictor variables X_{1} and X_{2}:

Use the following steps to fit a multiple linear regression model to this dataset.

**Step 1: Calculate X _{1}^{2}, X_{2}^{2}, X_{1}y, X_{2}y and X_{1}X_{2}.**

**Step 2: Calculate Regression Sums.**

Next, make the following regression sum calculations:

- Î£x
_{1}^{2 }= Î£X_{1}^{2 }â€“ (Î£X_{1})^{2}/ n = 38,767 â€“ (555)^{2}/ 8 =Â**263.875** - Î£x
_{2}^{2 }= Î£X_{2}^{2 }â€“ (Î£X_{2})^{2}/ n = 2,823 â€“ (145)^{2}/ 8 =Â**194.875** - Î£x
_{1}y = Î£X_{1}y â€“ (Î£X_{1}Î£y) / n = 101,895 â€“ (555*1,452) / 8 =**1,162.5** - Î£x
_{2}y = Î£X_{2}y â€“ (Î£X_{2}Î£y) / n = 25,364 â€“ (145*1,452) / 8 =**-953.5** - Î£x
_{1}x_{2}= Î£X_{1}X_{2}â€“ (Î£X_{1}Î£X_{2}) / n = 9,859 â€“ (555*145) / 8 =**-200.375**

**Step 3: CalculateÂ b _{0}, b_{1}, and b_{2}.**

The formula to calculate b_{1 }is: [(Î£x_{2}^{2})(Î£x_{1}y)Â â€“ (Î£x_{1}x_{2})(Î£x_{2}y)]Â / [(Î£x_{1}^{2}) (Î£x_{2}^{2}) â€“ (Î£x_{1}x_{2})^{2}]

Thus, **b _{1 }**= [(194.875)(1162.5)Â â€“ (-200.375)(-953.5)]Â / [(263.875) (194.875) â€“ (-200.375)

^{2}] =Â

**3.148**

The formula to calculate b_{2 }is: [(Î£x_{1}^{2})(Î£x_{2}y)Â â€“ (Î£x_{1}x_{2})(Î£x_{1}y)]Â / [(Î£x_{1}^{2}) (Î£x_{2}^{2}) â€“ (Î£x_{1}x_{2})^{2}]

Thus, **b _{2 }**= [(263.875)(-953.5)Â â€“ (-200.375)(1152.5)]Â / [(263.875) (194.875) â€“ (-200.375)

^{2}] =Â

**-1.656**

The formula to calculate b_{0 }is: y â€“ b_{1}X_{1}Â â€“ b_{2}X_{2}

Thus, **b _{0 }**= 181.5 â€“ 3.148(69.375) â€“ (-1.656)(18.125) =Â

**-6.867**

**Step 5: Place b _{0}, b_{1}, and b_{2}Â in the estimated linear regression equation.**

The estimated linear regression equation is:Â Å· =Â b_{0} + b_{1}*x_{1} + b_{2}*x_{2}

In our example, it isÂ **Å· = -6.867 + 3.148x _{1} â€“ 1.656x_{2}**

**How to Interpret a Multiple Linear Regression Equation**

Here is how to interpret this estimated linear regression equation: Å· = -6.867 + 3.148x_{1} â€“ 1.656x_{2}

**b _{0} = -6.867**. When both predictor variables are equal to zero, the mean value for y is -6.867.

**b _{1Â }= 3.148**. A one unit increase in x

_{1 }is associated with a 3.148 unit increase in y, on average, assuming x

_{2 }is held constant.

**b _{2 }= -1.656**. A one unit increase in x

_{2 }is associated with a 1.656 unit decrease in y, on average, assuming x

_{1 }is held constant.

**Additional Resources**

An Introduction to Multiple Linear Regression

How to Perform Simple Linear Regression by Hand