Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question 9e (applied.html) Chapter 03 #67

Open
faridcher opened this issue Jul 11, 2016 · 0 comments
Open

Question 9e (applied.html) Chapter 03 #67

faridcher opened this issue Jul 11, 2016 · 0 comments

Comments

@faridcher
Copy link

faridcher commented Jul 11, 2016

Q: Use the * and : symbols to fit linear regression models with interaction effects. Do any interactions appear to be statistically significant?

Your answer:
From the correlation matrix, I obtained the two highest correlated pairs and used them in picking my interaction effects. From the p-values, we can see that the interaction between displacement and weight is statistically signifcant, while the interactiion between cylinders and displacement is not.

Interaction is not relevent to the correlation. The interaction determines the influence of one predictor on the effectiveness of the other predictor on the response which is different from correlation.
We have cases where there is not correlation but there is interaction. For example in the Advertising dataset:

a = read.csv("data/Advertising.csv")
pairs(a)

No strong correlation between TV and Radio but there is interaction!

In addition, a better way to evaluate the interaction effect is to use .*. in the lm function; It will include all the predictors and the combination of all possible binary interactions:

sset = subset(Auto, select=-name)
fit = lm(mpg~.*.,sset)
summary(fit)

Note that the decision to include any interaction term in the final model is under the topic of model selection.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant