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.
Answer: As the number of calories increase the number of carbohydrates increase. It is a positive relationship between this two variables.
Answer: The explanatory variables is Calories and the response variables is carbohydrates.
Answer: We might want to predict the amount of carbohydrates a menu item has based on its calorie content.
Answer: The data show a linear trend and the residuals isn’t nearly normal. We have some outliners on the right side of the line. The variability of point around the least squares line is not constant, we can see the variability of y is larger when x is larger.
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}
Answer: When the shoulder girth increase, the height increase. It is a positive relationship between shoulder girth and height.
Answer: The positive relationship between shoulder girth and height is the same when shoulder girth was measured in inches, but the regression line for predicting height also change.
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.
Answer: According to the fomular y-\(y_0\)=slope*(x-\(x_0\))
slope<-(9.41/10.37)*0.67
slope
## [1] 0.6079749
We apply the number into the equation: y-171.14=0.6079749*(x-107.2), so y=0.60797x+105.964
Answer: The slop 0.6079749 is the number of centimeters increase in height for each increase in shoulder girth. The intercept 105.964 is the height in centimeters when the shoulder girth is 0 cm.
0.67^2
## [1] 0.4489
Answer: There is about 0.4489 in the data’s variation by using information about shoulder girth for predicting height using a linear model.
Answer:y=0.60797x+105.964=0.60797*100+105.964=166.761cm
Answer: Residual=160-166.761=-6.761. The negative residual indicates that the linear model over predicted height of the student by 6.761 cm.
Answer: The sample use the data of adult and the linear model can’t use on the children.
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}
Answer: y=-0.357+4.034*x
Answer: The intercept-0.357 means when the body weight equal to 0kg, the heart weight is -0.357 grams. This is not a meaningful value.
Answer: The slope 4.034 means For each additional kg increase in body weight, we expect an additional 4.034 grams in the heart weight.
Answer:There is about 64.66% in the data’s variation by using information about body weight for predicting heart weight using a linear model.
sqrt(0.6466)
## [1] 0.8041144
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}
Answer: \(b_0\)=y-\(b_1\)x, so \(b_1\)=(y-\(b_0\))/x
b<-(3.9983-4.010)/-0.0883
b
## [1] 0.1325028
Answer: The slop is 0.1325 means the linear relationship between teaching evaluation and beauty is very weak and near to 0.
Answer:
Linearity: From the scatter plot, there does appear to be some linearity if we take a horizontal slope.
Nearly Normal residuals: By looking at the histogram, residuals distribution is nearly normal.
Constant variability: From the scatter plot, the variability of points around the least squares line remains constant.
Independent observation: By look at the order of data collection, we don’t see obvious pattern that would suggest that these observations were dependent, so it is dependent.