HW 7

7.24

a)

It looks like as number of calories increase the carbohydrates also increases.

b)

Explanatory: Calories
Response: carbohydrates

c)

We would want fit a regression line to these data to esimate the number of carbohydrates in an item by knowing the number of calories.

d)

Linearity: The data does seem to linear.
Nearly normal residuals: Residuals are normal.
Constant variability: There isn’t constant variabilty, The residual chart shows that the residuals are scattered more as calories increase.
Independence: Each item on the menu should be independent of each other.

The data meets the conditions required for fitting a least squares line

7.26

a)

beta1 <- (9.41 / 10.37) * .67
beta0 <- (beta1 * -107.2) + 171.14

beta1
## [1] 0.6079749
beta0
## [1] 105.9651

y = 105.97 + 0.61x

b)

The slope shows the increase in height as shoulder girth increases. The incerpet is the height with a shoulder girth of 0.

c)

R2 <- .67^2
R2
## [1] 0.4489

This shows that this linear model explains 44.89% of the variation of the height data.

d)

height <- function(x) {
y  <- 105.97 + 0.61*x
return(y)
}

height(100)
## [1] 166.97

The srudent’s height would be around 167cm.

e)

160 - height(100) 
## [1] -6.97

The residual is -6.97. WIth a negative reidual our linear regression is over estimating.

f)

Looking back at 7.15 we see that the lowest shoulder girth was 85cm. We wouldn’t use our regression model to estimate this child’s height since he or she is out of our range.

7.30

a)

y = -0.357 + 4.034 * x

b)

The intercept shows that with a body with of 0kg a cat’s heart weight would be -0.357g. Basically there’s no cat…

c)

The slope shows that the cat’s heart weight is increasing by 4.034g for every 1g the body weight increases.

d)

R^2 tells us that the linear model describes 64.66% of the heart weight variation.

e)

R <- sqrt(.6466)
R
## [1] 0.8041144

The correlation coeffiecient is .804

7.40

a)

y <- 3.9983
x <- -.0883
beta0 <- 4.01

beta1 <- (y-beta0)/x
beta1
## [1] 0.1325028

The slope is .133

b)

These data does show that the slope of the relationship between teaching evaluation and beauty is positive. With the p-value being close to 0 we can conclude the slope to be positive.

c)

Linearity: There does seem to be some trend on the scatterplot so we can confirm linearity.
Nearly normal residuals: Looking at the residuals plot we can see the residuals as normal.
Constant variability: There is constant variability if we look at the residuals plot.
Independence: We can assume that these obersvations of professor ratings are indepent of each other.

We can perform linear regression here.