due Thursday, 9/27 at 11:59p

Introduction

This homework covers Simple Linear Regression (chapters 7 - 8 in the textbook). The exercise and page numbers refer to The Statistical Sleuth (3rd Edition) by Ramsey and Schafer. You may discuss the assignment with others; however, you must write and submit your own answers.

Please use the STA 210: HW 3 template to write up your assignment and submit your work as a PDF under the Assignments tab in Sakai. To ensure you have the updated template, run the R code below to update and load the STA210 package in R Studio.

devtools::install_github("matackett/sta210/STA210") 
library("STA210")


You will need the following libraries to complete the assignment:

library("tibble")
library("dplyr")
library("ggplot2")
library("broom")
library("Sleuth3") #data sets from the book

Homework Tip

To Transform or Not to Transform?

Finding the best transformation (if one is required) is sometimes a process of trial and error. When building a regression model, it is always good to start with a scatterplot of your response variable versus each of the explanatory variables. Sometimes you can determine whether a transformation is needed by viewing the relationship between the two variables on scatterplot. Display 8.6 on page 214 of the textbook has potential patterns you may see in the scatterplots and approaches for addressing them.

If you determine a transformation is required but are unsure the best one, you can view scatterplots of the data under different transformation conditions. For example, if you want to use a regression model to describe the relationship between the age of a child and his/her respiratory rate (see Ex. 8.24 in the textbook), you can view scatterplots under different transformation conditions to determine the best way to proceed.

## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggplot2':
## 
##     ggsave

The first regression model you calculate may not be the one you ultimately choose, but strategies like this will help you get started in the right direction!

Questions

Question 1. Ex. #7.24
Use the ex0724 data set in the Sleuth3 package.

Question 2. Ex. #7.27

Use the ex0727 data set in the Sleuth3 package.

Question 3. Ex. #7.28
Use the ex0728 data set in the Sleuth3 package. Note: Consider the appropriate analysis to answer each of the two questions asked in the exercise.

Question 4. Ex. #8.25
Use the ex0825 data set in the Sleuth3 package.

The question asks you to remove the Palm Beach observation when you calculate the regression model. You can use the code below to create a new data set with the Palm Beach data removed. (Note: If you are removing observations from a data set, it is good practice to save the updated data set under a new name, so you maintain a copy of the data with all of the original observations.)

# Choose a name for your updated data set and fill it in the blank space below 

________ <- ex0825 %>% filter(County != "Palm Beach")  

Submitting Your Assignment

Once you complete the assignment, you’re ready to Knit the file to create the PDF document. Click the Knit button in the menu bar.


Once you click Knit, your PDF will appear in a new window. If you don’t see a PDF, check the pop-up blockers on your web browser.

Once you knit the file, you should see the written text along with any R code and the resulting output and/or plots. If you want to change anything in your write-up, you can make changes in the R Markdown file and knit the document to generate the updated PDF.

Once you have created the PDF file, you can export it from the Docker container to your local machine. To export the file, click the Download button in the upper right-hand corner.



You can now submit the downloaded PDF under the Assignments tab on Sakai.