Instructions: This is an open book, open notes, and open Google/internet test. You may use R on your own computer or the lab computer. You may use a calculator.

Type your answers to the questions into an R Notebook. Answer the questions in order. Answer each the question that is asked above your R code chunks. You must write a sentence containing your answer.

Your files should have a name in the usual form for the class lastname_firstname_Stat651_Quiz1.Rmd and lastname_firstname_Stat651_Quiz1.docx or lastname_firstname_Stat651_Quiz1.pdf. Submit both files in Backboard before the end of class period.

Academic Honesty: As a student at CSU East Bay you are held to the standards stated in the Academic Dishonesty Policy. Copying another student’s work or allowing another student to copy your work is academically dishonest. I expect you to be academically honest while taking the test.

These question is related to the homework from Chapter 3.

For the RailTrail dataset from the mosaicData R package answer the following questions. The data is from Northampton, MA.

library(tidyverse)
library(mosaic)
  1. Create a scatterplot of the volume (number of crossing per day) against the high temperature that day.

Answer:

  1. Separate your previous plot into facets by weekday.

Answer:

  1. Examine the plot you have created in the previous question, is there anything about the plot that is unclear? Suggest a way to fix the issue you have described. Make a improved plot.

Answer:

  1. Separate your plot into facets by summer and weekday. The summer variable used for the rows and the weekday variable for the columns.

Answer:

  1. Examine the plot you have created in the previous question, is there anything about the plot that is unclear? Suggest a way to fix the issue you have described. Make a improved plot. Hint: Change the summer variable to a factor and use %+% to replace the data in the original plot p.

Answer:

  1. Add regression lines to the four facets. When does the relationship between volume and hightemp change?

Answer:

  1. (Extra Credit) Compute the slope of each regresion line. Hint: Use the map function from the purrr R package.

Answer:

  1. Plot volume versus each of the following variables: hightemp, lowtemp, cloudcover, precip. Add regression lines. Put the 4 plots into one ggplot using a function from the cowplot R package.

Answer:

  1. Export the RailTrail data to a .csv file and load it into the Tableau.
write_csv(RailTrail, "RailTrail.csv")
  1. Make the same plots in Tableau. Arrange them into a Story. Export the Story as a .pptx file.

Answer:

LS0tCnRpdGxlOiAiU3RhdC4gNjUxIFF1aXogMSIKb3V0cHV0OgogIHdvcmRfZG9jdW1lbnQ6IGRlZmF1bHQKICBodG1sX25vdGVib29rOiBkZWZhdWx0CiAgcGRmX2RvY3VtZW50OiB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