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. 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.

  1. Describe the relationship between number of calories and amount of carbohydrates (in grams) that Starbucks food menu items contain -The scatter plot indicates a positive correlation but because of the distance between points, we can assume it is a weak correlation. The points would be responsive to linear modeling based on their somewhat diagonal pattern.

  2. In this scenario, what are the explanatory and response variables? -If we build a regression line, we can predict carbs per menu item as a function of calorie counts.

  3. Why might we want to fit a regression line to these data? -A regression line could help us prove that Starbucks offers low carb food and diet food; A business motivation to attract health watchers.

  4. Do these data meet the conditions required for fitting a least squares line? -The plot shows us a potential linear relationship. Residual plot however seems to suggest that linear modeling might might not be the best for the data at hand. Perhaps apply transformation on the predictor variable using box-cox as a guide.

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.

  1. Write the equation of the regression line for predicting height.
x<-107.20
y<-171.14
Sx<-10.37
Sy<-9.41
R<-0.67

#slope
b0<-R*(Sy/Sx)
b0
## [1] 0.6079749

Solve the following equation \[ y-171.14=0.608(x-107.20) \] \[ y=105.9624+0.608(shoulder\quad girth) \] (b) Interpret the slope and the intercept in this context. slope: For each additional cm of shoulder girth, the linear model predicts an increase in height of 0.608cm Intercept: When shoulder girth is zero cm, we can expect the height to be 106 cm.

  1. Calculate R2 of the regression line for predicting height from shoulder girth, and interpret it in the context of the application.
R<-0.67
R_Squared<-(R)^2
R_Squared
## [1] 0.4489

About 45 percent of the variation in height is accounted for by shoulder girth.

  1. A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model. -We use our equation by computing a value when shoulder girth = 100
y<-105.9624+0.608*(100)
y
## [1] 166.7624
  1. The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means.
y1<-160
y2<-166.7624
e=y1-y2
e
## [1] -6.7624

We are currently overestimating height

  1. A one year old has a shoulder girth of 56 cm. Would it be appropriate to use this linear model to predict the height of this child? If we plug in a value of one into our model, we get roughly a height of 140 cm. This is clearly not a realistic height for a one year old. We can not use this model to predict the height of this child.

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.

  1. Write out the linear model. \[ Heart\_ wt=-0.357+4.034(Body\_ wt) \]
  2. Interpret the intercept. The intercept tells us that the expected weight of a cat having 0kg is -0.357. This is clearly not realistic, therefore the intercept has no meaning
  1. Interpret the slope The slope says that for each additional KG increase in weight, the heart weight will increase by 4.034g.

  2. interpret of R Squared 64.66% of the total variation in heart weight of cats can be explained by body weight

  1. Calculate the correlation coefficient
R=sqrt(0.6466)
R
## [1] 0.8041144

7.40 Rate my professor

  1. Given that the average standardized beauty score is -0.0883 and average teaching evaluation score is 3.9983, calculate the slope. Alternatively, the slope may be computed using just the information provided in the model summary table. compute the slope by solving for the estimate variable and plugging in the given info \[ T=\frac { Estimate-Null\_ Value }{ S.E } \] \[ 4.13=\frac { Estimate-0 }{ 0.0322 } \]

Estimate=0.1330

  1. Do these data provide convincing evidence that the slope of the relationship between teaching evaluation and beauty is positive? Explain your reasoning. We can come to a conclusion using a hypothesis test Ho: B0=0 Ha: B0>0 Using the given small p values, we can conclude that the slope is not zero (one sided hypothesis test) The slope coefficient is greater than zero indicating a positive relationship between a teaching evaluation and beauty.

  2. List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots. -linearity -nearly normal residuals -constant variability -independence of observations The scatter plot indicates a potential linear relationship. The residual plot indicates residuals follow the normality line closely. There is symmetry about the horizontal band suggesting constant variability. Because of the location of the points, we can also assume independence of observations.