The scatterplot below shows the relationship between the number of calories and amount of carbohydrates (in grams) Starbucks food menu items con- tain.21 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.
The relationship is positive. As the number of carbs goes up, so does the calorie count
Calorie is the explanatory variable and carb is the response variable
We might want to estimate the number of carbs for drinks of different calorie counts
We have linearity per the the scatterplot. The histogram shows apparent normal distribution. Variability does not seem too constant however. We have independence between Starbucks products
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.
y = 171.14 x = 107.20 sd_y = 9.41 sd_x = 10.37 r = 0.67 slope = 0.67(9.41/10.37) = 0.608
y = 0.608x + b0
171.14 = 0.608X107.20 + b0 b0 = 171.14 - 65.18 b0 = 105.96
Equation of the regression line: y = 0.608x + 105.96
For every 1cm increase in shoulder girth, we estimate an increase of 0.608cm in height.
R^2 = 0.67^2 = 0.449 The model explain 44.9% of the variation in the data
height = 0.608(100cm) + 105.96cm = 166.76cm
residual = 160 - 166.76 = -6.76cm The model overestimated the height of the student by 6.76cm
It would not be appropriate to use the model to predict the height of this child. It appears that the child is outside of the scope of the observations taken to build this model. E.g. these appear to be adults, and with the average shoulder girth being 107.56, the child’s height would not be estimated appropriately.
The following regression output is for predicting the heart weight (in g) of cats from their body weight (in kg). The cofficients are estimated using a dataset of 144 domestic cats.
heartweight = b1(bodyweight) + b0 heartweight = 4.034(bodyweight)-0.357
At a 0kg bodyweight we estimate the cats heartweight in grams to be -0.357g
For every 1kg increase in a cat’s bodyweight, we estimate the hearweight in grams to increase by 4.034g
The model explains 64.66% of the variation in the data
sqrt(R2) = 0.8041
Many college courses conclude by giving students the opportunity to evaluate the course and the instructor anonymously. However, the use of these student evalu- ations 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 ap- pearance 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.24 The scatterplot below shows the relationship between these variables, and also provided is a regression output for predicting teaching evaluation score from beauty score.
b0 = 4.010, b1 = 4.13(0.0322) = 0.1330
It doesn’t appear that there is any positive relationship between teaching evaluation and beauty per the scatter plot since there is no clear upward or downward trend.
The residuals are randonly scattered on the x-axis, indicating we have linearity. The histogram appears to have a left skew, indicating possible outliers The observations are independent of one another, showing what appears to be a linear trend there is a constant variance in the scatter plot