Simple Linear Regression, Prediction: Heart and Body Weights
Simple Linear Regression, Prediction: Heart and Body Weights
1. In the R package MASS there is a dataset called cats. Run the following commands:
library(MASS)
data(cats)
Have a look at the dataset. The variables Bwt and Hwt give the weight of the body (kg)
and the heart (g), respectively. There are both male and female cats. Make a dataset with
the data from males only.
2. Make a scatterplot of the data for the male cats (Bwt on x-axis, Hwt on y-axis). Does it
look reasonable to use a linear regression model for the data?
3. Fit a linear regresison model for the male cats, that allows for prediction of the heart
weight given the body weight. Add the fitted regression line to the scatterplot from the
previous question.
4. Find the coefficients of the fitted line. How large is the expected difference in heart
weight for two cats with a difference of 1 kg in bodyweight? Find a confidence interval
for this difference? How large is the expected difference in heart weight for two cats with
a difference of 100 g in bodyweight?
5. Use model validation plot to examine if the model is appropriate for the data.
6. Use the estimates to find the expected heart weight for a male cat that weighs 3 kg. Then
try the commands (where you replace the name regModel with whatever name you gave
the the model fit in question 2).