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.
Describe the relationship between number of calories and amount of carbohydrates (in grams) that Starbucks food menu items contain. Positive and fairly linear.
In this scenario, what are the explanatory and response variables? The response variable is calories. The explanatory variable is the grams of carbohydrates.
Why might we want to fit a regression line to these data? The data seem like they could be summarized well with a regression line.
Do these data meet the conditions required for fitting a least squares line? Yes. The residuals are normally distributed. There is no pattern aparent in the residuals plot. And the relationship looks linear as previously stated.
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.
\(\widehat{\text{height}}=\beta_0 + \beta_1\times\text{girth}\)
\(\beta_1 = \frac{s_\text{height}}{s_\text{girth}}R = \frac{9.41}{10.37}0.67 = 0.6079749\)
\(y - y_0 = \beta_1(x-x_0) \rightarrow y - 171.14 = 0.6079749 (x-107.20)\)
\(\beta_0 = 171.14 - (-107.2 \times 0.6079749) \rightarrow \beta_0 = 171.14 - 65.17491 \beta_0 = 105.9651\)
\(\widehat{\text{height}}=\beta_0 + \beta_1\times\text{girth} = 105.9651 + 0.6079749 \times \text{girth}\)
Interpret the slope and the intercept in this context. The intercept (average height) is roughly 106 centimeters. For every centimeter in sholder girth there is about 0.61 centimeters of height.
Calculate \(R^2\) of the regression line for predicting height from shoulder girth, and interpret it in the context of the application. \(R^2 = 0.67 \times0.67 = 0.4489\) This means that about 45% of the variability in height is explained by the sholder girth.
A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model. \(\widehat{\text{height}}= 105.9651 + 0.6079749 \times 100 = 105.9651 + 60.79749 = 166.7626\)
The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means. The residual is -6.7626 cm which is the amount overestimated by the model.
\(\text{Residual} = \text{Observed} - \text{Expected} = 160 - 166.7626 = 6.7626\)
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.
Estimate | Std. Error | t value | Pr(>\(abs(t)\)) | |
---|---|---|---|---|
(Intercept) | -0.357 | 0.692 | -0.515 | 0.607 |
body wt | 4.034 | 0.250 | 16.119 | 0.000 |
s = 1.452 \(R^2\) = 64.66% \(R^2\) adj = 64.41%
Write out the linear model. \(\widehat{\text{heart}} = -0.357 + 4.034 \times \text{body}\)
Interpret the intercept. The weight of the cat’s heart if it weighed nothing.
Interpret the slope. For every one kg of body weight there will be 4.034 grams of heart weight.
Interpret \(R^2\). Roughly 64% of the variation is explained by the cat’s body weight.
Calculate the correlation coefficient. \(R = \sqrt{R^2} = \sqrt{0.6466} = 0.8041144\)
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.
Estimate | Std. Error | t value | Pr(> | |
---|---|---|---|---|
(Intercept) | 4.010 | 0.0255 | 157.21 | 0.0000 |
beauty | 0.0322 | 4.13 | 0.0000 |
\(y - y_0 = \text{slope} \times (x - x_0)\)
\(4.010 - 3.9983 = \text{slope} \times (0 - -0.0883)\)
\(0.0117 =0.0883 \times \text{slope}\)
\(\text{slope}=\frac{0.0117}{0.0883} = 0.1325028\)
Do these data provide convincing evidence that the slope of the relationship between teaching evaluation and beauty is positive? Explain your reasoning. There is a positive slope however it is not very strong.
List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots. Linearity: Scatterplot indicates a positive relationship but it is weak. The slope is consistant with this. Nomally Distributed Residuals: The Q-Q Plot indicates it. Constant variability: The residuals scatterplot indicates this condition is met. Independent Observations: The evaluations is independant of the other.