Nutrition at Starbucks, Part I. (8.22, p. 326) The scatterplot below shows the relationship between the number of calories and amount of carbohydrates (in grams) Starbucks food menu items contain. 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 positive linear relationship between calories and carbs (in g) on the Starbucks menu.

  1. In this scenario, what are the explanatory and response variables?

In this case, the explanatory variable is calories and the response variable is carbohydrates.

  1. Why might we want to fit a regression line to these data?

There seems to be alinear relationship beteen the two variables, so they are a good cadidate for a regression line.

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

They do; the data trends towards linear and the samples are random in that they are not connected to each other in any way.


Body measurements, Part I. (8.13, p. 316) Researchers studying anthropometry collected body girth measurements and skeletal diameter measurements, as well as age, weight, height and gender for 507 physically active individuals. The scatterplot below shows the relationship between height and shoulder girth (over deltoid muscles), both measured in centimeters.

  1. Describe the relationship between shoulder girth and height.

There is a positive linear relationship between shoulder girth and height.

  1. How would the relationship change if shoulder girth was measured in inches while the units of height remained in centimeters?

The relationship is independent of units used, so it would not change.


Body measurements, Part III. (8.24, p. 326) Exercise above 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.

The equation for predicting height is: \[H = \beta_{1} * SG + \beta_{0}\]

SG_mean <- 107.2
SG_sd <- 10.37

H_mean <- 171.14
H_sd <- 9.41

R <- 0.67

B1 <- R * (H_sd / SG_sd)

B0 <- H_mean - B1 * SG_mean

translating to H = 0.6079749 * SG + 105.9650878

  1. Interpret the slope and the intercept in this context.

A slope equal to round(B1,4) indicates that for every 1 cm increase in Shulder Girth, the linear regression line predicts an increase of 0.608cm in height.

  1. Calculate \(R^2\) of the regression line for predicting height from shoulder girth, and interpret it in the context of the application.

R squared is 0.4489, meaning that 44.89% of the variation in the data can be explained away by this particular linear regression model.

  1. A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model.
H_at_100SG <- round(B1 * 100 + B0,2)

Plugging 100cm into the SG variable, we get 166.67 cm.

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

The residual for this individual is 6.67, meaning our prediction was 6.67cm higher than the true 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?

Since the lowest age looked at when collecting the data was 18, it does not account for how this distribution may change when looking at especially young subjects. It is therefore not appropriate to apply the regression function to the shoulder girth of a 1 year old.


Cats, Part I. (8.26, p. 327) The following regression output is for predicting the heart weight (in g) of cats from their body weight (in kg). The coefficients are estimated using a dataset of 144 domestic cats.

  1. Write out the linear model.

\[HW = 4.034 * BW - 0.357\]

  1. Interpret the intercept.

An intercept of -0.357 suggests that a Body weight of zero (0) would mean a negative Heart weight (which is impossible), so a body weight of zero is clearly irrelevant.

  1. Interpret the slope.

A slope of 4.034 indicates that for every kg increase in body weght for the cats, a more than 4g increase in heart weight is expected.

  1. Interpret \(R^2\).

The \(R^{2}\) value of around 65% suggests that 65% of the variation within the data can be explained through this model.

  1. Calculate the correlation coefficient.

R, the correlation coefficient, is 0.8041


Rate my professor. (8.44, p. 340) Many college courses conclude by giving students the opportunity to evaluate the course and the instructor anonymously. However, the use of these student evaluations as an indicator of course quality and teaching effectiveness is often criticized because these measures may reflect the influence of non-teaching related characteristics, such as the physical appearance of the instructor. Researchers at University of Texas, Austin collected data on teaching evaluation score (higher score means better) and standardized beauty score (a score of 0 means average, negative score means below average, and a positive score means above average) for a sample of 463 professors. The scatterplot below shows the relationship between these variables, and also provided is a regression output for predicting teaching evaluation score from beauty score.

  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.

\[Teval = \beta_{1} * Bscore + \beta_{0}\] \[\beta_{1} = \frac{Teval - \beta_{0}}{Bscore}\]

Teval <- 3.9983
B0 <- 4.010
Bscore <- -0.0883

B1 = (Teval - B0)/Bscore

The slope is 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.

A slope of 0.13 suggests a positive relationship between teaching evaluation and beauty.

  1. List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots.
  1. Linearity: Since a rough line can be drawn through the data, linearity is satisfied.

  2. Multivariate Normality: distributions of the variables eem to be fairly normal, so this criteria is met.

  3. Homoscedasticity: the residual plot of the data shows a fairly constant distribution of the residuals, so homoscedasticity is met.

  4. Independence: observations must be assumed to be independent of one another .