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.

  1. Describe the relationship between number of calories and amount of carbohydrates (in grams) that Starbucks food menu items contain. There appears to be a pattern where as calories increase, carbs also increase.

  2. In this scenario, what are the explanatory and response variables? The explanatory variable is the calories and the response variable is the carbohydrates.

  3. Why might we want to fit a regression line to these data? We might want to fit a regression line to these data to see if there actually is a strong relationship between the 2 variables.

  4. Do these data meet the conditions required for fitting a least squares line? independence: each menu item is independent of the next one residuals: the residuals appear to be almost normal linearity: the data appears to be following a linear pattern constant variabiloty: the residuals increase as calories increase

the conditions appear to be met for fitting a least squares line

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.

  1. Write the equation of the regression line for predicting height.
b <- (9.41/10.37)*.67
b0 <- 171.14 - b*107.2
b0
## [1] 105.9651

y=0.6079749x + 105.9651

  1. Interpret the slope and the intercept in this context. Someone with 0 cm shoulders will be 106 cm tall. This intercept doesn’t make sense, since no one can have shoulders that are 0 cm wide.

  2. Calculate R2 of the regression line for predicting height from shoulder girth, and interpret it in the context of the application. .67*.67=.4489 44.89% of the variation in height can be explained by shoulder girth.

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

a <- 100*b +b0
a
## [1] 166.7626

His predicted height is 166.7626 cm (e) The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means. 166.7626-160=6.7626cm, the expected value over estimated the actula value by 6.7 cm.

  1. 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, since this data is likely taken from a group of adults, so it wouldn’t make sense to apply it to a baby.

7.30 (a) Write out the linear model. y= -.357 + 4.034x

  1. Interpret the intercept. When the cat weighs 0 kg, the expected weight of the heart is -.357 g which is impossible.

  2. Interpret the slope. as the cat’s weight increases by 1 kg, the cat’s heart will increase by 4.034 grams.

  3. Interpret \(R^2\). 64.66% of the variation in the cat’s heart weight can be explained by the cat’s weight.

  4. Calculate the correlation coefficient. .6466^.5=0.8041144=r the correlation coefficient is 0.8041144.

7.40 (a) Given that the average standardized beauty score is -0.0883 and average teaching evaluation score is 3.9983, calculate the slope. Alternatively, the slope may be computed using just the information provided in the model summary table.

b0 <- 4.010

x <- -.0883
y <- 3.9983

b <- ((y - b0)/x) 
b
## [1] 0.1325028
  1. Do these data provide convincing evidence that the slope of the relationship between teaching evaluation and beauty is positive? Explain your reasoning.

Since \(R^2\) = 70.52%, I would say that the evidence is fairly convincing, but there could be other factors at play (age, relatability to students, gender, race, etc) The residuals are pretty normally distributed, which is another convincing aspect that there is a positive correlation.

  1. List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots. Normal distribution: the residuals are pretty normally distributed Constant variance: the residuals are randonly scattered about 0 Independence: this is assumed, since there is no evidence stating otherwise.