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.
    The relationship is positive and linear.

  2. In this scenario, what are the explanatory and response variables?
    Calorie is the explanatory variable, carb is the response variable.

  3. Why might we want to fit a regression line to these data?
    If we wanted to try to predict grams of carbs based on number of calories.

  4. Do these data meet the conditions required for fitting a least squares line?
    Residuals appear nearly normal (slight left skew), the data do show a linear trend, and there is no constant variability based on the residual plot. The observations may not be sufficiently independent for the results to be generalized to all food since they’re all from one restaurant.


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.

\begin{center} \end{center}

  1. Describe the relationship between shoulder girth and height.
    There appears to be a positive linear relationship.

  2. How would the relationship change if shoulder girth was measured in inches while the units of height remained in centimeters?
    The relationship shouldn’t change at all, the x-axis would just have smaller numbers. Higher heights in centimeters would still be correlated with larger shoulder widths in inches.


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.
mean_shoulder <- 107.2
sd_shoulder <- 10.37
mean_height <- 171.14
sd_height <- 9.41
corr <- 0.67

slope <- corr*(sd_height/sd_shoulder)
slope
## [1] 0.6079749
intercept = mean_height - slope*mean_shoulder
intercept
## [1] 105.9651

height = 105.9651 + 0.608 x shoulder girth

  1. Interpret the slope and the intercept in this context.
    The intercept is the height at a girth of 0. For every cm of increased shoulder girth, height would increase by 0.608 cm.

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

R_squared <- corr^2
R_squared
## [1] 0.4489

44.9% of the variation found in height is explained by shoulder girth.

  1. A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model.
105.9651 + 0.608 * 100
## [1] 166.7651

166.7651

  1. The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means.
    The residual is actual versus expected. So in this case it would be 160 - 166.7651 = -6.762. So the student is 6.762cm shorter than predicted by the model.

  2. 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?
    It would not be appropriate as the minimum shoulder girth in the sample population is over 80cm, while the minimum hight is above 140cm – so it’s hard to say if this model will apply to variables less than that. We know that eventually the model stops being accurate, as it would predict a height of 105.9651cm for someone with 0cm shoulder girth, which is obviously impossible.


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.

\begin{center} \end{center}

  1. Write out the linear model.
    heart weight = -0.357 + 4.034 * body weight

  2. Interpret the intercept.
    The intercept is -0.357

  3. Interpret the slope.
    The slope is 4.034.

  4. Interpret \(R^2\).
    Body weight explains 64.66% of the variability in the heart weight.

  5. Calculate the correlation coefficient.

sqrt(.6466)
## [1] 0.8041144

0.8041144


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.

\begin{center}

\end{center}

  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.
# y-intercept is 4.01 from the table
slope <- (3.9983 - 4.010)/(-0.0883)
slope
## [1] 0.1325028

The slope is 0.133.

  1. Do these data provide convincing evidence that the slope of the relationship between teaching evaluation and beauty is positive? Explain your reasoning.
    Yes they do provide convincing evidence as the slope has been calculated based on the means of all the data. However, the slope is not quite small which is why a purely visual intepretation of the scatterplot may lead someone to believe there is zero slope.

  2. List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots.

There is some linearity, a nearly horizontal line through the scatterplot points. The residuals looks nearly normal based on the histogram (slight right skew). The residuals plots seem to indicate constant variability. FInally, from the order of data collection, it appears that the observations are all independent.

Based on these criteria, we can perform these tests.