0% found this document useful (0 votes)
15 views6 pages

Regression Analysis of MPG and Predictors

The document discusses the impact of weight on miles per gallon (mpg) in a regression model, indicating that an increase in weight leads to a decrease in mpg, with only weight being statistically significant at the 5% level. It compares a full model with three predictors to a reduced model with two, concluding that the full model provides a better fit. Additionally, it presents a body fat calculation equation and explains the significance of correlation heatmaps in analyzing relationships between numerical variables.

Uploaded by

sigrid.s.lind
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Regression Analysis of MPG and Predictors

The document discusses the impact of weight on miles per gallon (mpg) in a regression model, indicating that an increase in weight leads to a decrease in mpg, with only weight being statistically significant at the 5% level. It compares a full model with three predictors to a reduced model with two, concluding that the full model provides a better fit. Additionally, it presents a body fat calculation equation and explains the significance of correlation heatmaps in analyzing relationships between numerical variables.

Uploaded by

sigrid.s.lind
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

a) The Coefficient (–3.16697)

●​ What it represents:​
The coefficient of –3.16697 for wt indicates the average change in miles per gallon
(mpg) for each one-unit increase in weight, while keeping the other variables (hp and cyl)
constant.​

●​ Practical interpretation:​
In this context, for every one-unit increase in weight, the model predicts a decrease in
mpg by about 3.17. This negative sign tells us that heavier cars are associated with
lower fuel efficiency.

(b) Which predictors are statistically significant at the 5% level?

We check the p-values:

●​ hp: p ≈ 0.140015 (greater than 0.05) → not statistically significant at the 5% level.​

●​ wt: p ≈ 0.000199 (less than 0.05) → statistically significant.​

●​ cyl: p ≈ 0.09848 (greater than 0.05) → not statistically significant at the 5% level.​

How we decide:​
The common rule is that if p < 0.05, we reject the null hypothesis that the coefficient is zero.
Here only wt meet that criterion, while hp and cyl does not.

(c) What is the R² value? What does it tell you here?

The output shows a Multiple R-squared of 0.8431.

This means that approximately 84.31% of the variability in mpg is explained by the
model (i.e. by hp, wt, and cyl).

Why use R²:​


R² is a measure of the goodness-of-fit. It tells us how well our independent variables explain the
variation in the dependent variable.

(d) What can you conclude about the sample size n?

The degrees of freedom for the residuals are given as 28. Recall that in a regression model​
n−(p+1)=Residual Degrees of Freedomn - (p + 1) = \text{Residual Degrees of
Freedom}n−(p+1)=Residual Degrees of Freedom​
where ppp is the number of predictors. Here, we have 3 predictors. So:

n−(3+1)=28⟹n=32.n - (3+1) = 28 \quad \Longrightarrow \quad n = 32.n−(3+1)=28⟹n=32.

Thus, the sample consists of 32 observations.

2. Theory + Programming Exercise: Test on Subset


We now compare the full model (using hp, wt, and cyl) with a reduced model (using only hp and
wt).

(a) Compare the full and reduced models

Key numbers from the output:

●​ Full model:​

○​ Multiple R² = 0.8431​

○​ Adjusted R² = 0.8263​

○​ Residual Standard Error (RSE) = 2.512 (with 28 degrees of freedom)​

●​ Reduced model:​

○​ Multiple R² = 0.8268​

○​ Adjusted R² = 0.8148​

○​ RSE = 2.593 (with 29 degrees of freedom)​

Interpretation:

●​ The full model explains a slightly higher proportion of variance (84.31% vs. 82.68%).​

●​ It has a lower residual standard error.​


●​ Although the difference is small, these numbers indicate that the full model is a better fit
to the data than the reduced model.

(b) State the null and alternative hypotheses for the partial F-test

When comparing a full model with a reduced model, we test whether the excluded predictor(s)
(here, cyl) contribute significantly.

C)
D)

(b) Data visualization

(c) Think carefully how you feed the data into the equation

BodyFat=​
450.0
−411.2×Density
+0.01259×Age
+0.01005×Weight
−0.007981×Height
−0.02846×Neck
+0.02678×Chest
+0.01857×Abdomen
+0.01917×Hip
−0.01676×Thigh
−0.004639×Knee
−0.08568×Ankle
−0.05505×Biceps
+0.03386×Forearm
+0.007345×Wrist.​

If abdomen changes by one unit, body fat changes by 54 unit. 1 / 1.857e-02 = 53,85

(e) Missing results from last week

Intersection ​ 450.0

"Density" ​ -411.2

"Age" ​ ​ 0.01259

"Weight" ​ 0.01005

"Height" ​ -0.007981

"Neck" ​ -0.02846

"Chest" ​ 0.02678

"Abdomen"​ 0.01857
"Hip" ​ 0.01917

"Thigh" ​ -0.01676

"Knee" ​ -0.004639

"Ankle" ​ -0.08568

"Biceps" ​ -0.05505

"Forearm" ​ 0.03386

"Wrist"​​ 0.007345

A correlation heatmap is a visual representation of the relationships be-

tween numerical variables. The values in the heatmap range from -1 to 1,

where:

1 (or close to 1) → Strong positive correlation (variables increase together).

0 → No correlation (variables are independent).

-1 (or close to -1) → Strong negative correlation (one variable increases

while the other decreases).

You might also like