7.24 Nutrition at Starbucks, Part I.

The scatterplot below shows the relationship between the number of calories and amount of carbohydrates (in grams) Starbucks food menu items con- tain.21 Since Starbucks only lists the number of calories on the display items, we are interested in predicting the amount of carbs a menu item has based on its calorie content.

(a) Describe the relationship between number of calories and amount of carbohydrates (in grams) that Starbucks food menu items contain.

As calories increase for an item, carbs increase as well. There appears to be a positive correlations but variation in residuals increases as calories increase.

(b) In this scenario, what are the explanatory and response variables?

The explantory variable is the calories of the items and response variable is the carbs of the item.

(c) Why might we want to fit a regression line to these data?

We want to use calories to predict carbs

(d) Do these data meet the conditions required for fitting a least squares line?

The data appears to meet the conditions for linearity, nearly normal residuals, constant variability, and independent observation

7.26 Body measurements, Part III.

Exercise 7.15 introduces data on shoulder girth and height of a group of individuals. The mean shoulder girth is 107.20 cm with a standard deviation of 10.37 cm. The mean height is 171.14 cm with a standard deviation of 9.41 cm. The correlation between height and shoulder girth is 0.67.

(a) Write the equation of the regression line for predicting height.

Sx <- 10.37
Sy <- 9.41
R <- 0.67

B1 <- (Sy/Sx)*R


xmean <- 107.2
ymean <- 171.14

B0 <- ymean - B1 * xmean
B0
## [1] 105.9651
B1
## [1] 0.6079749

The equation: y = 105.9651 + 0.6079749 * x

(b) Interpret the slope and the intercept in this context.

Slope would be the increase in height with each increase in shoulder girth. The intercept represents the height in cm when the shoulder girth = 0

(c) Calculate R2 of the regression line for predicting height from shoulder girth, and interpret it in the context of the application.

R2 <- R^2
R2
## [1] 0.4489
# 44.89 percent of the variation in height are explained by shoulder girth 

(d) A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model.

y <- 105.9651 + 0.6079749 * 100
y
## [1] 166.7626

(e) The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means.

160 - y
## [1] -6.76259
# the residual is negative meaning the prediction was above the actual height and an overestimate

(f) A one year old has a shoulder girth of 56 cm. Would it be appropriate to use this linear model to predict the height of this child?

No because it would be outside of the observed range of shoulder width, meaning we need to extrapolate

7.30 Cats, Part I.

The following regression output is for predicting the heart weight (in g) of cats from their body weight (in kg). The coe

(a) Write out the linear model.

y¯= −0.357 + 4.034 * x

(b) Interpret the intercept.

The intercept is at a negative value, which is a bit confusing because a cat’s heart must weigh some amount. If a cat were to some how weigh 0 pounds it would have a negative predicted heart weight

(c) Interpret the slope.

The slope is positive and just over 4, meaning when a cat gains 1 kg, its heart 4 kg

(d) Interpret R2.

This linear model using body weight describes about 64 percent of variation in a cats heart weight

(e) Calculate the correlation coeffcient.

R2 <- 0.6466
R <- sqrt(R2)
R
## [1] 0.8041144