Course Outline
-
segmentGetting Started (Don't Skip This Part)
-
segmentStatistics and Data Science: A Modeling Approach
-
segmentPART I: EXPLORING VARIATION
-
segmentChapter 1 - Welcome to Statistics: A Modeling Approach
-
segmentChapter 2 - Understanding Data
-
segmentChapter 3 - Examining Distributions
-
segmentChapter 4 - Explaining Variation
-
segmentPART II: MODELING VARIATION
-
segmentChapter 5 - A Simple Model
-
segmentChapter 6 - Quantifying Error
-
segmentChapter 7 - Adding an Explanatory Variable to the Model
-
segmentChapter 8 - Digging Deeper into Group Models
-
segmentChapter 9 - Models with a Quantitative Explanatory Variable
-
segmentPART III: EVALUATING MODELS
-
segmentChapter 10 - The Logic of Inference
-
segmentChapter 11 - Model Comparison with F
-
segmentChapter 12 - Parameter Estimation and Confidence Intervals
-
segmentPART IV: MULTIVARIATE MODELS
-
segmentChapter 13 - Introduction to Multivariate Models
-
segmentChapter 14 - Multivariate Model Comparisons
-
segmentChapter 15 - Models with Interactions
-
segmentChapter 16 - More Models with Interactions
-
16.4 Comparing the Interaction Model to the Additive Model with Two Quantitative Predictors
-
segmentFinishing Up (Don't Skip This Part!)
-
segmentResources
list College / Advanced Statistics with R (ABCD)
Book
16.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()
)
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