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.
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.
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.
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.
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.
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.
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.
y<-105.9624+0.608*(100)
y
## [1] 166.7624
y1<-160
y2<-166.7624
e=y1-y2
e
## [1] -6.7624
We are currently overestimating height
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.
Interpret the slope The slope says that for each additional KG increase in weight, the heart weight will increase by 4.034g.
interpret of R Squared 64.66% of the total variation in heart weight of cats can be explained by body weight
R=sqrt(0.6466)
R
## [1] 0.8041144
7.40 Rate my professor
Estimate=0.1330
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.
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.