= Solution
Write $Y_i=\log(\mathrm{price}_i)$ and fit the <normal linear model>
$$
Y_i=\beta_0+\beta_1\mathrm{mpg}_i+\beta_2\mathrm{psngr}_i+
\beta_3\mathrm{length}_i+\beta_4\mathrm{width}_i+
\beta_5\mathrm{weight}_i+\varepsilon_i.
$$
The basic <linear regression> analysis assumes centered independent <normal random variables> $\varepsilon_i$ of a common <variance> $\sigma^2$, conditional on the predictors. Independence between makes does not by itself establish independence between different models of the same make; that stronger assumption should be checked, or within-make dependence modelled. The requested R fit is
``
fit <- lm(log(price) ~ mpg + psngr + length + width + weight, data = cars)
``
The estimate column contains the <ordinary least squares> coefficients. The standard error estimates the <standard deviation> of each coefficient estimator. The t value is its estimate divided by its standard error. The last column gives the two-sided <p-value> for a zero coefficient, using a <Student t-distribution> with $93-6=87$ residual degrees of freedom under the stated <normal linear model>; the stars summarize significance thresholds.
Conditional on the other predictors, passenger capacity and width have negative fitted coefficients, while length and weight have positive ones. All four are significant at the conventional 5% level; length is borderline. There is little evidence for an additional mpg effect once the others are included. These are conditional associations, not causal claims. For example, increasing weight by 100 pounds multiplies the fitted price by approximately $\exp(0.08373)$, about 1.087.
A reasonable candidate simplification removes mpg and compares the nested models by an <F-test>, rather than treating a nonsignificant coefficient as proof of no effect:
``
fit2 <- update(fit, . ~ . - mpg)
anova(fit2, fit)
``
Inspect <regression residuals>, normal quantiles, residual-versus-fitted plots, leverage and influential observations. The correlated size predictors may produce <multicollinearity>; missing make effects, nonlinear terms or unequal residual variances may also matter. A random make effect or a covariance adjustment addresses the possible dependence noted above.
Back to article page