Multiple Regression Notes
Multiple Regression
In this chapter, you learn:
- How to develop a multiple regression model
- How to interpret the regression coefficients
- How to determine which independent variables to include in the regression model
- How to determine which independent variables are most important in predicting a dependent variable
- How to use categorical independent variables in a regression model
- How to predict a categorical dependent variable using logistic regression
- How to identify individual observations that may be unduly influencing the multiple regression model
The Multiple Regression Model
Idea: Examine the linear relationship between 1 dependent (Y) & 2 or more independent variables ()
Multiple Regression Model with k Independent Variables:
(1)
Multiple Regression Equation
The coefficients of the multiple regression model are estimated using sample data
Multiple regression equation with k independent variables:
(2)
Where:
- = Estimated or predicted value of Y
- = Y intercept
- = slope coefficients
Example: 2 Independent Variables
A distributor of frozen dessert pies wants to evaluate factors thought to influence demand
Dependent variable:
- Pie sales (units per week)
Independent variables:
- Price (in $)
- Advertising ($100’s)
Data are collected for 15 weeks
| Pie Sales | Price | Advertising |
|---|---|---|
| 350 | 5.5 | 3.3 |
| 460 | 7.5 | 3.3 |
| 350 | 8.0 | 3.0 |
| 430 | 8.0 | 4.5 |
| 350 | 6.8 | 3.0 |
| 380 | 7.5 | 4.0 |
| 430 | 4.5 | 3.0 |
| 470 | 6.4 | 3.7 |
| 450 | 7.0 | 3.5 |
| 490 | 5.0 | 4.0 |
| 340 | 7.2 | 3.5 |
| 300 | 7.9 | 3.2 |
| 440 | 5.9 | 4.0 |
| 450 | 5.0 | 3.5 |
| 300 | 7.0 | 2.7 |
Excel Multiple Regression Output
The Multiple Regression Equation
(3)
where:
- Sales is in number of pies per week
- Price is in $
- Advertising is in $100’s.
- : sales will decrease, on average, by 24.975 pies per week for each $1 increase in selling price, net of the effects of changes due to advertising.
- : sales will increase, on average, by 74.131 pies per week for each $100 increase in advertising, net of the effects of changes due to price.
Using The Equation to Make Predictions
Predict sales for a week in which the selling price is $5.50 and advertising is $350:
(4)
Note that Advertising is in $100s, so $350 means that
- Predicted sales is 428.62 pies
The Coefficient of Multiple Determination,
Reports the proportion of total variation in Y explained by all X variables taken together.
(5)
Adjusted
never decreases when a new X variable is added to the model
- This can be a disadvantage when comparing models
What is the net effect of adding a new variable?
- We lose a degree of freedom when a new X variable is added
- Did the new X variable add enough explanatory power to offset the loss of one degree of freedom?
shows the proportion of variation in Y explained by all X variables adjusted for the number of X variables used
R^2_{adj} = 1 − [\frac{(1 − r^2)(\frac{n − 1}{n − k − 1})] (6)
(where n = sample size, k = number of independent variables)
- Penalizes excessive use of unimportant independent variables
- Smaller than
- Useful in comparing among models
Using Dummy Variables
A dummy variable is a categorical independent variable with two levels:
- yes or no, on or off, male or female
- coded as 0 or 1
Assumes the slopes associated with numerical independent variables do not change with the value for the categorical variable
If more than two levels, the number of dummy variables needed is (number of levels - 1)
Dummy-Variable Example (with 2 Levels)
(7)
Let:
Y = pie sales
= price
= holiday ( = 1 if a holiday occurred during the week)
( = 0 if there was no holiday that week)
No Holiday
(8)
Holiday
(9)
Interpreting the Dummy Variable Coefficient (with 2 Levels)
Example:
(10)
Sales: number of pies sold per week
Price: pie price in $
Holiday: 1 If a holiday occurred during the week
0 If no holiday occurred
= 15 on average, sales were 15 pies greater in weeks with a holiday than in weeks without a holiday, given the same price
Dummy-Variable Models (more than 2 Levels)
The number of dummy variables is one less than the number of levels
Example:
Y = house price ;
= square feet
If style of the house is also thought to matter:
- Style = ranch, split level, colonial
Three levels, so two dummy variables are needed.
Example:
Let ‘‘colonial’’ be the default category, and let and be used for the other two categories:
Y = house price
= square feet
= 1 if ranch, 0 otherwise
= 1 if split level, 0 otherwise
The multiple regression equation is:
(11)
Table 2: Housing Data
| Style | House Price in $1000s (Y) | Square Feet (X) | Ran | SL |
|---|---|---|---|---|
| Col | 245 | 1400 | 0 | 0 |
| Col | 312 | 1600 | 0 | 0 |
| Col | 279 | 1700 | 0 | 0 |
| Col | 308 | 1875 | 0 | 0 |
| Col | 199 | 1100 | 0 | 0 |
| Col | 219 | 1550 | 0 | 0 |
| Col | 405 | 2350 | 0 | 0 |
| Col | 324 | 2450 | 0 | 0 |
| Col | 319 | 1425 | 0 | 0 |
| Col | 255 | 1700 | 0 | 0 |
| SL | 345 | 1400 | 0 | 1 |
| SL | 412 | 1600 | 0 | 1 |
| SL | 379 | 1700 | 0 | 1 |
| SL | 408 | 1875 | 0 | 1 |
| SL | 299 | 1100 | 0 | 1 |
| SL | 319 | 1550 | 0 | 1 |
| SL | 505 | 2350 | 0 | 1 |
| SL | 424 | 2450 | 0 | 1 |
| SL | 419 | 1425 | 0 | 1 |
| SL | 355 | 1700 | 0 | 1 |
| Ran | 295 | 1400 | 1 | 0 |
| Ran | 362 | 1600 | 1 | 0 |
| Ran | 329 | 1700 | 1 | 0 |
| Ran | 358 | 1875 | 1 | 0 |
| Ran | 249 | 1100 | 1 | 0 |
| Ran | 269 | 1550 | 1 | 0 |
| Ran | 455 | 2350 | 1 | 0 |
| Ran | 374 | 2450 | 1 | 0 |
| Ran | 369 | 1425 | 1 | 0 |
| Ran | 305 | 1700 | 1 | 0 |
Table 3: Base Data
| Coefficient | Estimate | std error | t-stat | p.value |
|---|---|---|---|---|
| Intercept | 148.2483296 | 46.2150008 | 3.207797 | 0.0033386 |
| Sq. Ft | 0.1097677 | 0.0262552 | 4.180794 | 0.0002583 |
Table 4: Colonial as Default Data
| Coefficient | Estimate | std error | t-stat | p.value |
|---|---|---|---|---|
| Intercept | 98.2483296 | 33.7844924 | 2.908090 | 0.0073480 |
| Sq. Ft | 0.1097677 | 0.0182882 | 6.002122 | 0.0000024 |
| Ranch | 50.0000000 | 17.7583557 | 2.815576 | 0.0091643 |
| Split Level | 100.0000000 | 17.7583557 | 5.631152 | 0.0000064 |
Interpreting the Dummy Variable Coefficients (with 3 Levels)
Consider the regression equation:
(12)
For a colonial:
(13)
For a ranch:
(14)
With the same square feet, a ranch will have an estimated average price of 50 thousand dollars more than a colonial.
For a split level:
(15)
With the same square feet, a split-level will have an estimated average price of 100 thousand dollars more than a colonial.
Logistic Regression
Used when the dependent variable Y is binary (i.e., Y takes on only two values)
Examples
- Customer prefers Brand A or Brand B
- Employee chooses to work full-time or part-time
- Loan is delinquent or is not delinquent
- Person voted in last election or did not
Logistic regression allows you to predict the probability of a particular categorical response
Logistic regression is based on the odds ratio, which represents the probability of an event of interest compared with the probability of not an event of interest
(16)
- The logistic regression model is based on the natural log of this odds ratio