7.24 Nutrition at Starbucks, Part I.

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

There is an upward positive trend between the two variables. In other words, an increase in the amount of carbohydrates within the menu encourages an increase in the amount of calorie count.

  1. In this scenario, what are the explanatory and response variables?
  1. Why might we want to fit a regression line to these data?

To predict the how much calories are in the menu based on the amount of carbs.

  1. Do these data meet the conditions required for ???tting a least squares line?

7.26 Body measurements, Part III.

  1. Write the equation of the regression line for predicting height.

\(\hat{y} = \beta_0 + \beta_1 * x\)

\(\beta_1 = \frac{s_y}{s_x}R\)

beta1 <- (9.41 / 10.37) * 0.67

beta1
## [1] 0.6079749
xmean <- 107.20
ymean <- 171.14

beta0 <- ymean - (beta1 * xmean)
beta0
## [1] 105.9651

Equation: \(\hat{y} = 105.965 + 0.608x\)

  1. Interpret the slope and the intercept in this context.
  1. Calculate R2 of the regression line for predicting height from shoulder girth, and interpret it in the context of the application.
R_squared <- 0.67^2
R_squared
## [1] 0.4489
  1. A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model.
height <- 105.965 + (0.608 * 100)

height
## [1] 166.765
  1. The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means.
residual <- 160 - height
residual
## [1] -6.765

The residual is negative so it means that the model overestimates the height.

  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?

Based on the provided plot from Question 7.15, the range for shoulder girth on the model is between 90cm and 130. So no this model would not be appropriate because it is outside of the sample.

Cats, Part I

  1. Write out the linear model.

\(-0.357 + 4.034x\)

  1. Interpret the intercept.
  1. Interpret the slope.
  1. Interpret \(R^2\).
  1. Calculate the correlation coecient.
sqrt(0.6466)
## [1] 0.8041144

7.40 Rate my professor.

  1. 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.
beta0 <- 4.010
y <- 3.9983
x <- -0.0883

beta1 <- (y - beta0) / x
beta1
## [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 the slope is positive, it shows with every positive beauty score received, the teachers evaluation improve by 0.13.

  1. List the conditions required for linear regression and check if each one is satis???ed for this model based on the following diagnostic plots.