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.
Answer : The relationship appear to be moderately strong and positive.
Answer : Explanatory variable is calories and response variable is carbohydrates
Answer : Because there is linear relationship between the two variables and we can make prediction from such a relationship
Answer : Yes the data meets the conditions
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.
Answer : It appears linear, and positively correlated.
Answer : The relationship wouldn’t change with change in centimeters to inches for girth. The plot would be more horizontally shrunk
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.
Answer : \[ he\hat{i}ght_i = 126.1503 + 0.4196798 * girth_i \]
Answer : On an average the height of a person in 126.1503 when shoulder girth is not considered. For each unit increase in shoulder girth increases the height by 0.4196798 times the shoulder girth.
Answer : This means around 45% of the variability in height can be explained by shoulder girth.
R <- 0.67
R^2
## [1] 0.4489
Answer :
slope <- 0.67*(107.2/171.14)
estimated100 <- 126.1503 + slope*100
estimated100
## [1] 168.1183
Answer : 160 - 168 = -8, negative residual means the model overestimated the height of the student
Answer : It would not be appropriate to use this model
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}
Answer : \[ hea\hat{r}twt_i= 4.034∗bodywt_i −0.357 \]
Answer : Average heart weight will be -0.357 grams when body weight is 0.
Answer : For 1 unit increase in weight heart weight increase by 4.034 grams on average
Answer : \(R^2\) = 64.66%, which means 64.66 % of the variability in heart weight is explained by body weight.
R2 <- 0.6466
sqrt(R2)
## [1] 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}
Answer : Slope is 0.1325028
# Given values
x <- -0.0883
y <- 3.9983
b0 <- 4.010
# Slope
b1 <- (y - b0) / x
b1
## [1] 0.1325028
Answer : The p-value is so small that we reject the null hypothesis and conclude that beauty and teaching evaluation are not positively correlated.
Answer :
No, the conditions for linear regression are not met. It does not meet the condition of nearly-normal residuals.
Linearity: There does not appear to be a clear pattern of the residuals, suggesting that it may be due to a linear relationship.
Nearly normal residuals: The residuals apear to be slightly left-skewed, based on the histogram and normal plot.
Constant variablity: There appear to be roughly the same degree of residuals above and below the horizonal line, suggesting constant variability.