Chapter 6 Mulitcollinearity

6.1 Exercise 1

Consider the sleep data set from this chapter. You can load the data and then drop any observations with missing predictors using:

library(openintro)
library(dplyr)
data(mammals, package="openintro") 
mammals <- mammals %>% dplyr::select(total_sleep, life_span, gestation,
                          brain_wt, body_wt, predation, 
                          exposure, danger) %>%
                       filter(complete.cases(.))
  1. Reproduce the output in the Book showing VIFs associated with the following model:
fullmodel <- lm(total_sleep ~ log(body_wt) + log(brain_wt) + life_span + gestation + 
    predation + exposure + danger, data= mammals)
  1. Consider pairwise correlations among the different predictor variables and your understanding of what these variables measure. Using this information, eliminate 2 or more predictors from consideration. How does eliminating these predictors change the VIFs? How do the estimated coefficients and their standard errors change once collinear variables are eliminated?