Chapter 1 Linear Regression Review
1.1 Exercise 1
For this exercise, we will consider the LizardBite
data set in the abd
library (Middleton & Pruim, 2015). This data set was collected by Lappin & Husak (2005) and featured in a problem in Whitlock & Schluter (2015)’s popular introductory statistics book. Lappin & Husak (2005) was interested in whether the bite force (bite
) of male lizards in the species Crotaphyutus collaris was predictive of their territory size (territory
).
Fit a linear model using R that could be used to predict territory size from a lizard’s bite force.
Evaluate the assumptions of the model using graphical methods. Be sure to comment on what you are looking for in each plot (e.g., the assumption you are looking to evaluate and what would constitute an assumption violation).
Interpret the intercept and slope parameters in the context of the problem.
Provide a confidence interval for the slope parameter and interpret the confidence interval.
Use the
summary
function to further explore the regression model. You will see two test statistics and two p-values. Write down the null and alternative hypotheses for these hypothesis tests. Show how you can calculate the test statistics from other output given by thesummary
function. Show how you can calculate the p-value using thept
function in R.Explain what the standard error associated with the slope parameter tells us. Your explanation should include reference to a sampling distribution, and you should define what this term means.
Create a confidence interval for the mean territory size associated with a bite force of 5 and a prediction interval for a lizard that has a bite force of 5. Explain the difference between the two intervals. When would you prefer the latter type of interval?
This exercise can be repeated with any number of different data sets. Students could also be allowed to choose their own data set or from a list of data sets. The abd
library (Middleton & Pruim, 2015) contains several other data sets, including ZooMortality
and Rattlesnakes
that could be used for this exercise.