8.2
- birth_weight = 120.07 - 1.93 x parity
- The slope is effectively a 1.93 “penalty” for being non-first born. i.e., birth_weight is 120.07 ounces for first born and 118.14 for non-first born.
- No, the p-value is above 0.05
8.4
- days_absent = 18.93 - 9.11 x eth + 3.10 x sex + 2.15 x lrn
- Being not aboriginal results in a prediction of 9.11 days less than aboriginal. For male prediction is 3.1 days more than female. For slow learner prediction is 2.15 days more than average learner.
- (y - y_predicted) = 2 - 24.18 = -22.18
- R2 = 1 - (240.57/264.17) = 0.089
- adjusted R2 = 1 - (240.57/264.17) x (145/142) = 0.07
8.16
- There is one outlier value but after that there seems to be only a slight relationship.
- The key components are that the coefficient for Temperature is negative, indicating that probability of O-ring failure decreases as temperature rises, and the p-value for Temperature is near 0, indicating that it is a statistically significant predictor.
- log(p_failure/(1-p_failure)) = 11.663 - 0.2162 x Temperature
- Yes, see answer above. There seems to be a statistically significant relationship between Temperature and O-ring failure. (This does not speak towards the relationship between O-ring failure and shuttle failure, however.)
8.18
get_prob <- function(temp){
exp(11.663 - 0.2162*temp)/(1 + exp(11.663 - 0.2162*temp))
}
### (a)
get_prob(51)
## [1] 0.6540297
get_prob(53)
## [1] 0.5509228
get_prob(55)
## [1] 0.4432456
### (b)
temps <- seq(51, 71, 2)
plot(temps, sapply(temps, get_prob), type="l", xlab = "Temperature", ylab="Probability of O-ring Failure")

### (c)
# The data should be mostly independent, though there may have been changes after each flight and the book does not show chronological order of the data.
# We can visually see our linearity assumption between Temperature and logit(p):
plot(temps, sapply(temps, function(x) 11.663 - 0.2162*x), xlab = "Temperature", ylab = "logit(p)")
