Course Outline

list College / Advanced Statistics with R (ABCD)

Book
  • High School / Advanced Statistics and Data Science I (ABC)
  • High School / Statistics and Data Science I (AB)
  • High School / Statistics and Data Science II (XCD)
  • High School / Algebra + Data Science (G)
  • College / Introductory Statistics with R (ABC)
  • College / Advanced Statistics with R (ABCD)
  • College / Accelerated Statistics with R (XCD)
  • CKHub: Jupyter made easy

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

Responses