library(tidyverse)
library(tidymodels)
library(patchwork)
AE 03: Bike rentals in Washington, DC
Simple linear regression
Go to the course GitHub organization and locate your ae-03
repo to get started. If you do not see an ae-03
repo, click here to create one.
Render, commit, and push your responses to GitHub by the end of class. The responses are due in your GitHub repo no later than Saturday, September 9 at 11:59pm.
Data
Our data set contains daily rentals from the Capital Bikeshare in Washington, DC in 2011 and 2012. It was obtained from the dcbikeshare
data set in the dsbox R package.
We will focus on the following variables in the analysis:
count
: total bike rentalstemp_orig
: Temperature in degrees Celsiusseason
: 1 - winter, 2 - spring, 3 - summer, 4 - fall
Click here for the full list of variables and definitions.
<- read_csv("data/dcbikeshare.csv") bikeshare
Exercises
Exercise 1
Below are visualizations of the distributions of daily bike rentals and temperature as well as the relationship between these two variables.
<- ggplot(bikeshare, aes(x = count)) +
p1 geom_histogram(binwidth = 250) +
labs(x = "Daily bike rentals")
<- ggplot(bikeshare, aes(x = temp_orig)) +
p2 geom_histogram() +
labs(x = "Temperature (Celsius)")
<- ggplot(bikeshare, aes(y = count, x = temp_orig)) +
p3 geom_point() +
labs(x = "Temperature (Celsius)",
y = "Daily bike rentals")
| p2) / p3 (p1
[Add your answer here]
Exercise 2
# add code developed during livecoding here
Exercise 3
# add code developed during livecoding here
Exercise 4
[Add your answer here]
Exercise 5
# add code developed during livecoding here
Exercise 6
# add code developed during livecoding here
Exercise 7
[Add your answer here]
Exercise 8
[Add your answer here]
Exercise 9
[Add your answer here]
Exercise 10
[Add your answer here]
To submit the AE:
- Render the document to produce the PDF with all of your work from today’s class.
- Push all your work to your
ae-03-
repo on GitHub. (You do not submit AEs on Gradescope).