R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

7.24 Nutrtion at Starbucks

A.

  • There appears to be a positive relation between calories and carbohydrates. Looking at the residuals it seems as though the line underestimates the actual value of carbs when the value of carbs becomes higher.

B.

  • The explanatory variable is the calorie count. The response variable is the carbs

C.

  • A regression line can help us to see if higher calorie foods have more carbs or help us predict the amount of carbs if we are given the calorie count on a menu item

D.

  • The residuals seem to be centered around 0 and mostly normal.

7.26 Body measurements, Part III

A.

  • \((y-y_0)=B_1(x-x_0)\)
  • \(B_1= S_y/S_x*R\)
  • y-171.14= .90(x-107.2)
  • y=.61x(shoulder_girth)+ 106
R=.67
b_1 <- 9.41/10.37*.67
b_1
## [1] 0.6079749
y=b_1*-107.2+171.14
y
## [1] 105.9651

B.

  • For every .61 increase in girth, height increases by an inch

C.

  • .45. This means that 45% of the variation in the response is explained by the explanatory variable
r=.67
r_2 <- .67^2
r_2
## [1] 0.4489

D.

  • y=y=.61x(100)+ 106
  • 167
student_height<-.61*100+ 106

E.

  • \(e_i = y_i ˆ yhati\)
  • 160-167 =-7
  • This means that our model over predicted the height of the student by 7 cm

F.

  • No this would be an example of Extrapolation. Our population mostly deals with a specific range of individuals, going outside that range we don’t know how the relationship between height and girth behaves

7.30 Cats, Part I

A.

  • y(heart weight)= 4.034(x) -.357

B.

  • At a body weight of 0, heart weight is -.357. Obviously this is outside the range of most of our data points, as weight can’t be negative

C.

  • For every kg of body weight increase, we see an increase of 4.034 grams in heart weight

D

  • 64.66%
  • This means that 64.66% of the variation in the heart weight is explained by the body weight

E

  • 0.80
sqrt(.6466)
## [1] 0.8041144

7.40

A.

  • Being that our means intersection is a point on the regression line
  • \(y= mx+b\) 3.9983=4.01 +B_1(-.0883) B_1= .13
my_slope <-(3.9983-4.01)/(-.0883)
paste(my_slope)
## [1] "0.132502831257076"

B.

  • The hypothesis test results in the chart show that with a t statistic of 4 and a p value of near 0, there is a clear relationship between teaching evaluations and beauty

C.

  • Linearity- looking at the scatter plot there appears to be a linear trend, as most attractive teachers tend to have high ratings and some unattractive teachers have low ratings.
  • Nearly normal residuals- the residuals appear close to normal
  • Constant variability- the residuals appear to have constant variability
  • Independent observations- we have no reason to believe the observations violate independence