Homework 23
Instructions:
For each of the following problems:
- Use R to generate a scatter plot of the predictor versus the response.
- Print out the scatter plot.
- Annotate the print out with a description of the trend between the predictor and the response and its strength.
- Use R to estimate the linear regression model using lm. Record the slope and intercept reported by R.
- Interpret the slope and intercept of the linear regression model in the context of the problem.
- Write the prediction function \(\widehat{y} = b_{0} + b_{1}x\), substituting in the appropriate values for the parameters.
- Use summary to find the standard error of prediction. Record the standard error of prediction.
- Use R to compute the median absolute error of prediction. Interpret the median absolute error of prediction in the context of the problem.
- Give the prediction for the response variable at the specified value of the predictor variable. That is, evaluate \(\widehat{y} = b_{0} + b_{1} x\) at the given value of the predictor.
Problems
- Use Pearson's height data from the course website, but predict the heights of the fathers using the heights of their sons. Complete each of the steps above. For Step 9, predict the height of the father of a 6 foot tall son. Are the slope and intercept for predicting the height of a father from the height of his son the same as the slope and intercept for predicting the height of a son from the height of his father?
- Use the SAT data from the wooldridge library in R:
- You need to install the library in R using: install.packages("wooldridge")
- You need to load the library using: library(wooldridge)
- The data frame can be accessed through the data frame: wooldridge::gpa2
Predict the first semester GPA (colgpa) of a student using the size of their graduating class (hsize, which is reported in 100s of students). For Step 9, predict the first semester GPA of a student who had a high school graduating class (approximately) the same size as your high school graduating class. How close is this to your GPA for your first semester in college? Does it makes sense to use the regression model fit to this data set to predict your first semester GPA? Why or why not?