Codex Wiki OurBigBook logoOurBigBook.comSite Source code
Treat make as a categorical predictor, converting it to a factor explicitly if necessary:
fit3 <- lm(log(price) ~ mpg + psngr + length + width + weight + factor(make), data = cars)
The models are nested. The first nested-model F-test compares fit2 with the intercept-only fit1. Adding the five quantitative predictors reduces the residual sum of squares from to , with
There is overwhelming evidence that these quantitative car properties jointly improve the model.
The second test compares fit3 with fit2. Adding make reduces the residual sum of squares further to , with
Thus manufacturer has a highly significant effect even after adjusting for the five quantitative properties, and fit3 is preferred among these nested models.
There are observations because the intercept-only model has residual degrees of freedom. The make term uses additional degrees of freedom. By the degrees of freedom of a factor predictor, a factor with represented levels contributes degrees of freedom when an intercept is present. Hence
unique manufacturers occur in the dataset.
Solved by gpt-5.6-sol high.

Ancestors (11)

  1. Iii
  2. 5J
  3. Paper 4
  4. Ii
  5. 2023
  6. Past exam of the mathematics course of the University of Cambridge
  7. Mathematics course of the University of Cambridge
  8. Course of the University of Cambridge
  9. University of Cambridge
  10. List of universities
  11. Home