3 Linear Regression 3
3 Linear Regression 3
3 Linear Regression 3
21
• H0 : β1 = β2 = · · · = βp = 0
• Ha: at least one slope βj 0
22
1
9/29/2021
23
24
2
9/29/2021
Variable Selection
Forward stepwise selection:
• Begin with the null model:
• model that contains an intercept but no predictors.
• Fit p simple linear regressions and add to the null model the
variable that results in the lowest RSS.
• Add to that model the variable that results in the lowest RSS for
the new two-variable model.
25
• The new (p − 1)-variable model is fit, and the variable with the
largest p-value is removed.
26
3
9/29/2021
• However, after adding each new variable, the method may also
remove any variables that no longer provide an improvement in
the model fit.
• the p-values for variables can become larger as new predictors are added
to the model. (p-value rises above a certain threshold).
27
3. Model Fit
• The model that uses only TV and radio to predict sales has an R2
value of 0.89719; only TV as a predictor had an R2 of 0.61
28
4
9/29/2021
Observations
• Adding radio to the model leads to a substantial improvement in
R2 (TV + Radio better prediction; higher R2 and smaller RSE)
• There is a small increase in R2 if we include newspaper
advertising in the model that already contains TV and radio
advertising.
• Previously observed: p-value for newspaper advertising is not significant.
• Additional evidence that newspaper can be dropped from the model
29
4. Predictions
• Once we have fit the multiple regression model, it is
straightforward to predict the response Y on the basis of a set
of values for the predictors.
30
5
9/29/2021
Other Issues/Considerations
• Qualitative Predictors
• Interaction Terms
• Non-linear effects
• Multicollinearity
• Model Selection
31
Qualitative Predictors
• Investigate differences in credit card balance between males and
females, ignoring the other variables for the moment.
32
6
9/29/2021
33
34
7
9/29/2021
35
36
8
9/29/2021
37
Observations
• We can interpret β3 as the increase in the effectiveness of TV
advertising for a one unit increase in radio advertising (or vice-versa).
• The R2 for the model is 96.8%, compared to only 89.7% for the model
that predicts sales using TV and radio without an interaction term.
38
9
9/29/2021
(Multi) Collinearity
• Situation in which two or more predictor variables are closely
related to one another.
39
40
10