7.24 Nutrition at Starbucks, Part I. 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.
Answer: The relation b/w number of calories and amount of carbohyrates is linear.
In this scenario, what are the explanatory and response variables? Answer: In this scenario, the explanatory variable is Calories and response variable is Carbohydrates
Why might we want to fit a regression line to these data? Answer: We want to fit a regression line to these data to find a better least squares line which has minimal residuals
Do these data meet the conditions required for fitting a least squares line? Answer: Not all the conditions are met for fitting a least squares line. A simple linear model is inadequate for modeling these data, since the residuals are not normal.
7.26 Body measurements, Part III. 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.
sx <- 10.37
sy <- 9.41
R <- .67
b1 <- R * sy/sx
xmean <- 107.2
ymean <- 171.14
b0 <- ymean - b1 * xmean
Answer: b0 (105.965) represents the intercept and b1(0.608) represents the slope.
RSq <- R^2
x <- 100
y <- b0 + b1*x
y
## [1] 166.7626
y <- 160
R <- y - ymean
R
## [1] -11.14
Answer: No, since the girth range doesn’t fall under the earlier given data range, we cannot use the linear model.
7.30 Cats, Part I. 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.
\[ \hat{heartWt } = -.357 + 4.034 * bodywt \]
Interpret the intercept.
Answer: The intercept is -.357, which is not meaningful since a negative weight doesn’t make sense.
Interpret the slope.
Answer: The slope is 4.034, which says that for every percentage increase in body weight there is 4.034 times increase in the heart weight in gms.
Answer: The R2 value is given as 64.66%, which indicates the variability in heart weight measures.
7.40 Rate my professor. 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.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.
teachingMean <- 3.9983
beautyMean <- -.0883
intercept <- 4.010
#teachingMean <- intercept + Slope*beautyMean
slope <- (teachingMean - intercept) / beautyMean
slope
## [1] 0.1325028
Answer: Since the slope 0.1325028 is positive, it tends to be a positive relation b/w teaching evaluation and beauty. But at the same time, the slope is not extremely high, so we cannot say that beauty drastically impacts the teaching evaluation.
Answer: The below conditions have to be satisfied 1. Normal residuals: Yes, the residuals seems to be near normal. 2. Linearity: Yes, the data doesn’t seem to follow a linear pattern. 3. Constant Variabiity: The variability of the points from least squares lines can be assumed(from the scatter plot) to be near equal. 4. Independent Observations: Yes, the observations seem to be independent.