Lab 05: Putting it all together

Due: Tuesday 2020-11-24 at 5pm

Getting started

Packages

In this lab we will work with one package: faraway.

If you need to install this package, run the following code once in your Console:

install.packages("faraway")

If you’d like to run your code in the Console as well you’ll also need to load the packages there. To do so, run the following in the console.

library(faraway) 

Note that the packages are also loaded with the same commands in your R Markdown document.

Data

We will work with two data frames today: stackloss and mammalsleep, both from thefaraway package. To load the data add the following to your .Rmd file:

data("stackloss")
data("mammalsleep")

To find out more about the dataset, type the following in your Console: ?stackloss. A question mark before the name of an object will always bring up its help file. This command must be ran in the Console.

Remember: The Console is at the bottom of your RStudio workspace. Things you type in the Console will not be in your final report. This is a good place to peek at data (try typing stackloss in the Console) and look at help files with the ?.

Exercises

  1. Using all of the tools we’ve learned so far in this class, use the stackloss data set to predict Stack loss using the remaining variables, fitting an appropriate model. Be sure to include:
  1. Using all of the tools we’ve learned so far in this class, use the mammalsleep data set to predict sleep using the remaining variables, fitting an appropriate model. Be sure to include: