Stat. 651 Quiz 1

Author

Prof. Eric A. Suess

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

Type your answers to the questions into an Quarto/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.qmd and lastname_firstname_Stat651_Quiz1.html or lastname_firstname_Stat651_Quiz1.pdf. Submit both files in Canvas.

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 regression 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: