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.
7.24
From the scatterplot, there seems to be a positive, moderately strong linear association between calories and carbs.
Explanatory: number of calories Response: amount of carbohydrates (in grams)
We can predict carbs for a given number of calories using a regression line. This may be useful information for determining whether or not a particular food from Starbucks fits into your diet.
Linearity:The relationship between calories and carbs in the scatterplot appears to be linear.
Nearly Normal Residuals:The residuals is nearly normal as shown in the histogram.
Constant Variability:The variability of residuals around the 0 line has a fan shape on the residuals plot. Thus the data doesn’t meet the conditions required for fitting a least squares line.
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.
\(\bar{x}=107.20\) \(s_x=10.37\) \(\bar{y}=171.14\) \(s_y=9.41\) correlation \(R=0.67\)
Slope: \(b_1 = \frac{s_y}{s_x}R = \frac{9.41}{10.37}\times0.67 = 0.61\)
Intercept: \(b_0 = \bar{y}-b_1\bar{x} = 171.14-0.61\times107.2 = 105.75\)
Equation of the regression line: \(\hat{y} = \beta_0 + \beta_1 x\) \[height = 105.75+0.61\times shoulder girth\]
Slope \(b_1\): For each addition cm in should girth, the model predicts an additional 0.61cm in height.
Intercept \(b_0\): When the should girth is 0cm, the height is exected to be 105.75cm. It doesn’t make sense to have a shoulder girth of 0cm in this context. Here, the y-intercept serves only to adjust the height of the line and is meaningless by itself.
\(R^2 = 0.67^2 = 0.45\) About 45% of the variability in height is accounted for by the model, i.e. explained by the shoulder girth.
\(height = 105.75+0.61\times shoulder girth\) \(height = 105.75+0.61\times 100 = 166.75cm\)
\(e_i = y_i - \hat{y_i} = 160 - 166.75 = -6.75\) A negative residual means that the model overestimates the height.
No, this calculation would require extrapolation.
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.
7.30.1
7.30.2
\(\hat{heartWeight} = -0.357 + 4.034 \times \hat{bodyWeight}\)
Expected heart weight of a cat with no body weight is -0.357. This is obviously not a meaningful value, it just serves to adjust the height of the regression line.
For each additional kilogram increase in body weight of a cat, the model predicts an addition gram in heart weight of the cat.
The body weight explains 64.66% of the variability in heart weights of cats.
\(R = \sqrt{R^2} = \sqrt{0.6466} = 0.804\)
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.
7.40.1
\(b_0 = \bar{y} - b_a\bar{x}\) \(b_1 = \frac{\bar{y} - b_0}{\bar{x}} = \frac{3.9983 - 4.010}{-0.0883} = 0.1325\)
Since the slope is positive, the relationship between teaching evaluation and beauty is positive. However, they are not strongly correlated.
7.40.2
Linearity: Check using a residuals plot, the relationship between teaching evaluation and beauty appears to be linear.
Nearly normal residuals: Check using a histogram and normal Q-Q plot of residuals, we see that the residuals are nearly normal.
Constant variability: The variability of residuals around the 0 line is roughly constant as well.