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.
Solution: It looks like a linear relationship where the carbohydrates increases as the calories increases.
Solution: Carbohydrate is the responses variable while calories is the explanatory variable
Solution: To predict the amount of carbs based on the number of calories consumed
Solution: Linearity: The data seems to be linear. Normal residuals: Residuals tends to be normal. Constant variability: There isn’t constant variabilty. Independence: Observations should be independent of each other.
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.19 The scatterplot below shows the relationship between height and shoulder girth (over deltoid muscles), both measured in centimeters.
\begin{center} \end{center}
Solution: There is a positive linear relationship between shoulder girth and height.
Solution: Changing the units for one of the variables will not change the direction or strength of the relationship between the two variables.
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.
Solution:
x <- 10.37
y <- 9.41
R <- 0.67
b1 <- (y / x) * R
b1
## [1] 0.6079749
xhat <- 107.2
yhat <- 171.14
b0 <- yhat - b1 * xhat
b0
## [1] 105.9651
The equation: y’ = 105.97 + 0.61x
Solution: The slope shows the increase in height as shoulder girth increases.
Solution:
R2 <- .67^2
R2
## [1] 0.4489
Solution:
h <- function(x) {
y <- 105.97 + 0.61*x
return(y)
}
h(100)
## [1] 166.97
The predicted student height is 166.76 cm.
Solution:
r <- 160 - h(100)
r
## [1] -6.97
The residual is -6.97 which indicates that te student height is less than expected height.
Solution:
No. It will not be appropriate to estimate this child’s height using the model since the height is out of the range.
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}
Solution: Hwt=−0.357+4.034(Bwt)
Solution: Not applicable
Solution: For additional 1 kg in body weight, the heart will weigh an additional 4.034 grams
Solution: 65 percent of the variance in heart weight is explained by body weight.
Solution:
r <- sqrt(64.66/100)
r
## [1] 0.8041144
The correlation coefficient is 0.8041
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}
Solution:
y <- 3.9983
x <- -0.0883
beta0 <- 4.01
#Slope
beta1 <- (y - beta0)/x
beta1
## [1] 0.1325028
Solution:
The slope beta1 is positive at 0.1325 indicating a positive correlation between beauty and teaching
Solution:
Linearity: There is n pattern in the data which shows that the data appear to be linear. Normal Residuals: The residuals appear to be nearly normal. Constant Variability: The obsrvations seem to be evenly spread out indicating constant variability. Independent Observations: Observations seems to be independent of each other.