As usual, all code below should follow the style guidelines from the lecture slides.
grades_data <- read.csv("https://www.openintro.org/data/csv/gpa.csv")
Create a scatter plot with GPA on the y-axis and and hours studied per week on the x-axis. What do you observe?
Use the lm
function to regress gpa
upon studyweek
. What are the estimated coefficients? What are their interpretations?
Use the lm
function to regress gpa
upon sleepnight
and studyweek
. What are the estimated coefficients? What are their interpretations?
We can write the model used in question 4 as \[\mathbf{Y}=\mathbf{X}\boldsymbol\beta+\boldsymbol\epsilon\]. What is \(\mathbf{Y}\) here? What is \(\mathbf{X}\) here. Create the matrix \(X\) in your .Rmd file and print out the first six rows.