Course Outline
-
segmentGetting Started (Don't Skip This Part)
-
segmentStatistics and Data Science II
-
segmentPART I: EXPLORING AND MODELING VARIATION
-
segmentChapter 1 - Exploring Data with R
-
segmentChapter 2 - From Exploring to Modeling Variation
-
segmentChapter 3 - Modeling Relationships in Data
-
segmentPART II: COMPARING MODELS TO MAKE INFERENCES
-
segmentChapter 4 - The Logic of Inference
-
segmentChapter 5 - Model Comparison with F
-
segmentChapter 6 - Parameter Estimation and Confidence Intervals
-
segmentPART III: MULTIVARIATE MODELS
-
segmentChapter 7 - Introduction to Multivariate Models
-
segmentChapter 8 - Multivariate Model Comparisons
-
segmentChapter 9 - Models with Interactions
-
segmentChapter 10 - More Models with Interactions
-
10.4 Comparing the Interaction Model to the Additive Model with Two Quantitative Predictors
-
segmentFinishing Up (Don't Skip This Part!)
-
segmentResources
list High School / Statistics and Data Science II (XCD)
Book
10.4 Comparing the Interaction Model to the Additive Model with Two Quantitative Predictors
The most direct way to compare the interaction model to the additive model is to produce the ANOVA table for the interaction model, and then zero in on one row.
Use the code window below to generate the ANOVA table for the interaction model.
require(coursekata)
# generate the ANOVA table for the interaction model
# (no models have been pre-saved for you)
# generate the ANOVA table for the interaction model
# (no models have been pre-saved for you)
supernova(lm(PriceK ~ YearBuilt * HomeSizeK, data = Ames))
# or alternatively: supernova(lm(PriceK ~ HomeSizeK * YearBuilt, data = Ames))
ex() %>% check_or(
check_function(., "supernova") %>%
check_result() %>%
check_equal(),
override_solution(., "supernova(lm(PriceK ~ HomeSizeK * YearBuilt, data = Ames))") %>%
check_function("supernova") %>%
check_result() %>%
check_equal()
)
CK Code: D4_Code_Comparing_01
We added in an argument to the supernova()
function to make the ANOVA table a little less cluttered with detail.
supernova(lm(PriceK ~ YearBuilt * HomeSizeK, data = Ames), verbose = FALSE)
Analysis of Variance Table (Type III SS)
Model: PriceK ~ YearBuilt * HomeSizeK
SS df MS F PRE p
------------------- | ---------- --- ---------- ------- ------ -----
Model | 528182.561 3 176060.854 301.958 0.8335 .0000
YearBuilt | 179.332 1 179.332 0.308 0.0017 .5799
HomeSizeK | 7731.615 1 7731.615 13.260 0.0683 .0004
YearBuilt:HomeSizeK | 9392.093 1 9392.093 16.108 0.0817 .0001
Error | 105534.655 181 583.064
------------------- | ---------- --- ---------- ------- ------ -----
Total | 633717.215 184 3444.115