MATH 456 Homework 04
Due 2026-03-05 by 11:59pm
- Download the following dataset into your Homework 04 repository:
carnivora.
Here's the
metadata.
Please
pushthis dataset along with yourqmdfile for Homework 04. I don't need the output file nor any of the output file's dependencies.
We'll focus on the variables SW and SB.
SWrepresents body weight in kilogramsSBrepresents brain weight in grams
-
Use
dplyr's functionsselectandmutateto select only the variables of interest, throw away any rows containingNAs, and rename the variables to something more meaningful. -
Use
ggplot2to make a scatter plot withSWon the x-axis andSBon the y-axis. As it is, describe this plot and speak about the reasonableness of fitting a line through these data. -
Make a new plot with both axes on the
log10scale. Describe this plot and speak about the reasonableness of fitting a line through these data. -
Fit a linear model that appropriately matches the plot above.
-
Make a new plot with both axes on their original scale and put on the plot the fitted curve from the model above.
-
Make a histogram of the standardized residuals.
-
Make a scatter plot of the standardized residuals on the y-axis and the predicted values, what we've called
, on the x-axis. -
How well does this model fit the assumptions linear models? Explain.
-
Fit a linear model that uses a quadratic function of
SW. -
Make a new plot with both axes on their original scale and put on the plot the fitted curve from the model above.
-
Make a histogram of the standardized residuals.
-
Make a scatter plot of the standardized residuals on the y-axis and the predicted values, what we've called
, on the x-axis. -
How well does this model fit the assumptions linear models? Explain.
-
Compare the mean squared errors for both models above. Be sure to make your comparison meaningful; pay careful attention to the units.
-
Which model seems to predict the brain weight of animals from the order Carnivora better? Explain.