Nutrition at Starbucks, Part I. (8.22, p. 326) b

(a) Describe the relationship between number of calories and amount of carbohydrates (in grams) that Starbucks food menu items contain.

There is a positive relationship between number of calories and amount of carbohydrates. There is a near linearity in the plot.

(b) In this scenario, what are the explanatory and response variables?

Calorie is explanatory Variable Carbohydrate is response variable

(c) Why might we want to fit a regression line to these data?

To predict the Carbs based on calories count.

(d) Do these data meet the conditions required for fitting a least squares line?

Independence- We can assume its independence unless otherwise stated. Linearity- Based on first graph, it appears linear. Normal Residual-Based on histogram, the model has a bell shape and is slightly skewed uni model. Constant Variability- based on residuals graph, residuals are not constant. Or not spread apart equally. The lest has smaller concentration with small residuals while to the right the residual are larger. The 4th condition is not satisfied for Least square line.


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.

\begin{center} \end{center}

(a) Describe the relationship between shoulder girth and height.

There is a positive relationship and correlation between the two.

(b) How would the relationship change if shoulder girth was measured in inches while the units of height remained in centimeters?

It would still be a positive relatinship with a steeper slope. as the width of X axis will decrease.


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.

(a) Write the equation of the regression line for predicting height.

height=105.8445+0.6091∗shoulder girth

sh_girth_mean <- 107.20
sh_girth_sd <- 10.37 

height_mean <- 171.14
height_sd <- 9.41

cor <- 0.67

#calculate slope
B1 <- (height_sd/sh_girth_sd)*cor
B1
## [1] 0.6079749
B0=round(B1 * -sh_girth_mean + height_mean , 4)
B0
## [1] 105.9651

(b) Interpret the slope and the intercept in this context.

The intercept of 105.9651 represents the height in centimeters at shoulder girth of 0 cm.

The slope of 0.6080 represents the rate of change in height for each centimeter change in shoulder girth.

(c) Calculate \(R^2\) of the regression line for predicting height from shoulder girth, and interpret it in the context of the application.

r2 <- round(cor^2,2)
r2
## [1] 0.45

(d) A randomly selected student from your class has a shoulder girth of 100 cm. Predict the height of this student using the model.

The predicted height is 166.76

girth <- 100
pre_height <- B0 + B1*girth
pre_height
## [1] 166.7626

(e) The student from part (d) is 160 cm tall. Calculate the residual, and explain what this residual means.

The residual on -6.76 is how far away from the estimate and how accurate the model is.

160-pre_height
## [1] -6.762593

(f) 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?

Since 56 cm seems like an outlier as it is almost 5 SD away from the mean so it would be inappropriate to predict height of the individual with 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}

(a) Write out the linear model

HeartWight =−0.357+4.034∗bodyweight

(b) Interpret the intercept.

We expect the heart weight of -0.357 grams if cat weight is 0 kgs. This doesn’t make sense in real life.

(c) Interpret the slope.

For each additional kg of body weight, we can expect cat’s heart weigh additional 4.034 grams

(d) Interpret \(R^2\).

66.66% of the observations can be explained by our linear model.

(e) Calculate the correlation coefficient.

R2=.6466
round(sqrt(R2),3)
## [1] 0.804

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}

(a) 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.

B0=4.010
Slope=4.13 * 0.0322
Slope
## [1] 0.132986

(b) Do these data provide convincing evidence that the slope of the relationship between teaching evaluation and beauty is positive? Explain your reasoning.

No, There is no evidence that there is a relationship.Slope of is almost .1 which is close to zero.

(c) List the conditions required for linear regression and check if each one is satisfied for this model based on the following diagnostic plots.

Residuals are constant across the residual graph.

The histogram of residuals shows a normal bell shape but slightly left skewed.

QQ plpt shows linearity.

There is independence shown in observation.