In: Statistics and Probability
Problem (7) With the rmr data set (ISwR package), plot metabolic rate versus body weight. Fit a linear regression model to the relation. According to the fitted model, what is the predicted metabolic rate for a body weight of 80kg?
The R code is given below for this exercise. Let x = body weight
and y = metabolic rate.
library(ISwR)
rmr
attach(rmr)
# PLOTTING BODY WEIGHT AS x AND METABOLIC RATE AS Y
plot(body.weight,metabolic.rate,main = "Plot of Metabolic Rate vs.
Body Weight")
# THE LINEAR REGRESSION MODEL
md = lm(metabolic.rate ~ body.weight)
summary(md)
The plot of metabolic rate versus body weight is given below.
The summary of the linear regression model is given below.
Call:
lm(formula = metabolic.rate ~ body.weight)
Residuals:
Min 1Q Median 3Q Max
-245.74 -113.99 -32.05 104.96 484.81
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 811.2267 76.9755 10.539 2.29e-13
***
body.weight 7.0595 0.9776 7.221 7.03e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’
1
Residual standard error: 157.9 on 42 degrees of
freedom
Multiple R-squared: 0.5539, Adjusted R-squared:
0.5433
F-statistic: 52.15 on 1 and 42 DF, p-value:
7.025e-09
The linear regression model has come out to be: y = 811.2267 +
(7.0595 * x).
Putting x = 80, we get y = 1375.987 kcal/24hr.