Solution (source code)

= Solution

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 $8584.0$ to $3349.1$, with
$$
F=69.7334,\qquad p<2.2\times10^{-16}.
$$
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 $840.8$, with
$$
F=5.3891,\qquad p=2.541\times10^{-8}.
$$
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 $93$ observations because the intercept-only model has $92=93-1$ residual degrees of freedom. The make term uses $31$ additional degrees of freedom. By the <degrees of freedom of a factor predictor>, a factor with $m$ represented levels contributes $m-1$ degrees of freedom when an intercept is present. Hence
$$
m-1=31,
\qquad
\boxed{m=32}
$$
unique manufacturers occur in the dataset.