In: Math
An exercise science major wants to try to use body weight to predict how much someone can bench press. He collects the data shown below on 30 male students. Both quantities are measured in pounds.
Body weight |
Bench press |
148 |
145 |
176 |
148 |
154 |
133 |
189 |
156 |
181 |
166 |
217 |
174 |
210 |
168 |
150 |
139 |
137 |
109 |
151 |
119 |
172 |
138 |
219 |
167 |
142 |
131 |
143 |
119 |
164 |
151 |
136 |
124 |
147 |
149 |
129 |
134 |
219 |
162 |
169 |
140 |
180 |
149 |
187 |
156 |
198 |
149 |
156 |
131 |
220 |
149 |
154 |
138 |
212 |
147 |
122 |
122 |
163 |
133 |
136 |
136 |
b) Compute a 95% confidence interval for the average bench press
of 150 pound males. What is the lower limit? Give your answer to
two decimal places.
c) Compute a 95% confidence interval for the average bench press of
150 pound males. What is the upper limit? Give your answer to two
decimal places.
d) Compute a 95% prediction interval for the bench press of a 150
pound male. What is the lower limit? Give your answer to two
decimal places.
e) Compute a 95% prediction interval for the bench press of a 150
pound male. What is the upper limit? Give your answer to two
decimal places.
Answer:
We can solve it by using R software. First import the given data set into R.
R-code for confidence and prediction interval:
attach(data); #Attach given data set.
x = `Body weight`; # Denote independent variable Body
weight = x.
y = `Bench press`; # Denote dependent variable Bench press
= y.
reg_model = lm(y ~ x); # For generating simple linear
regression model.
reg_model;
newdata = data.frame(x = 150); #for attaching the new value of
Body weight = 150. #We now apply the predict function and set the
predictor variable in the newdata argument. We also set the
interval type as "predict" or "confidence", and use the default
0.95 confidence level.
predict(reg_model, newdata, interval = "confidence" ); #
For estimating confidence interval for average Bench press.
predict(reg_model, newdata, interval = "predict"); # For
estimating prediction interval for average Bench press.
Then from the R output:
reg_model:
Call:
lm(formula = y ~ x)
Coefficients:
Intercept | x |
70.1712 | 0.4284 |
Confidence Interval:
Fit | Lower | Upper |
134.436 | 130.0678 | 138.8042 |
Prediction Interval:
Fit | Lower | Upper |
134.436 | 113.9732 | 154.8989 |
Ans (b):
Lower limit of confidence interval = 130.07
Ans (c):
Upper limit of confidence interval = 138.80
Ans (d):
Lower limit of prediction interval = 113.97
Ans (e):
Upper limit of prediction interval = 154.90