Reputation: 1511
My question is in the title. I am unsure if the non-interaction terms are being accounted for as the output of drop1 does not include them, but only the interaction terms. The code and output is as follows:
> temp = lm(auto.mpg.data$mpg ~ auto.mpg.data$weight + auto.mpg.data$model_year + auto.mpg.data$origin + auto.mpg.data$weight:auto.mpg.data$model_year + auto.mpg.data$weight:auto.mpg.data$origin + auto.mpg.data$model_year:auto.mpg.data$origin)
> drop1(temp, test="F")
Single term deletions
Model:
auto.mpg.data$mpg ~ auto.mpg.data$weight + auto.mpg.data$model_year +
auto.mpg.data$origin + auto.mpg.data$weight:auto.mpg.data$model_year +
auto.mpg.data$weight:auto.mpg.data$origin + auto.mpg.data$model_year:auto.mpg.data$origin
Df Sum of Sq RSS AIC F value Pr(>F)
<none> 3769.8 908.83
auto.mpg.data$weight:auto.mpg.data$model_year 1 300.625 4070.4 937.37 31.1807 4.407e-08 ***
auto.mpg.data$weight:auto.mpg.data$origin 1 94.557 3864.3 916.69 9.8074 0.001869 **
auto.mpg.data$model_year:auto.mpg.data$origin 1 0.027 3769.8 906.83 0.0028 0.958085
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 `enter code here`
Upvotes: 1
Views: 3155
Reputation: 81753
Yes, the drop1
functions accounts for the lower-level terms if an interaction is present. If a predictor is part of an interaction, it will not be dropped.
Upvotes: 4