Q: 7.24, 7.26, 7.30, 7.40
Ans
The relationship is a linear, positive , moderately strong relationship between number of calories and amount of carbohydrates
Explanatory variable: Calories on the x axis.
Response variable: Carbohydrates on the y axis.
So as to predict the amount of carbs a menu item has based on its calorie content.
Linearity: Yes the relationship between the calories and carbohydrates appear to be linear
Nearly normal Residuals: The residual plot displays a nearly normal histogram
Constant Variability: this relationship violates constant variabliliy
Therefore we conclude conditions are not met for fitting a least square line
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. (a) Write the equation of the regression line for predicting height.
Ans
\[ y = \beta_0 + \beta_1 \cdot x \] \[ \beta_1 = \frac{S_y}{S_x}R \]
Sx <- 10.37
Sy <- 9.41
R <- 0.67
b1 <- (Sy / Sx) * R
b1
## [1] 0.6079749
x0 <- 107.2
y0 <- 171.14
b0 <- y0 - b1 * x0
b0
## [1] 105.9651
The equation for the regression line for predicting height will be:
y = 105.9650878 + 0.6079749 * x
Response variable - Height
the intercept is the estimated average height if the grith is 0
the slope is the estimated rate of per unit increase of height to a unit increase in shoulder grith
R <- 0.67
R2 <- R^2
R2
## [1] 0.4489
44.89% of the variability in the height of perople is explained by the model
x <- 100
y = 105.9650878 + 0.6079749 * x
y
## [1] 166.7626
the predicted height of the student is 166.7626
the residual is 160 - 166.7626 = -6.7626
A measure of 56 is outside the sample and we would require extrapolation and would not be appropriate to predict height for children.
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.
\[\bar{y} = - 0.357 + 4.034 \cdot x \]
The intercept will be at -0.357. This value tells us that this model will predict a negative heart weight when the cat’s body weight is 0.
the slope of 4.034 tells us that the heart weight increases by 4.034 grams for each 1kg of body weight increase.
the R2=64.66% tells us that the linear model describes 64.66% of the variation in the heart weight.
Rate my professor. 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 e???ectiveness 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.24 The scatterplot below shows the relationship between these variables, and also provided is a regression output for predicting teaching evaluation score from beauty score.
b0 <- 4.010
x <- -0.0883
y <- 3.9983
b1 <- (y - b0) / x
The slope for is: 0.1325028.
since B1 os 0.13250 and looking at the slope is positive
Linearity: linearity is satisfied weakly
Nearly normal residuals: As shown in the residuals distribution and Q-Q plot, they are in fact nearly normal.
Constant variability: The scatterplot of the residuals does appear to have constant variability.
Independent observations: Assuming independence 463 professors would likely be < 10% of nationwide professors,and are rated individually