8.18 Challenger disaster, Part II. Exercise 8.16 introduced us to O-rings that were identified as a plausible explanation for the breakup of the Challenger space shuttle 73 seconds into takeoff in 1986. The investigation found that the ambient temperature at the time of the shuttle launch was closely related to the damage of O-rings, which are a critical component of the shuttle. See this earlier exercise if you would like to browse the original data.
temperature <- c(53,57,58,63,66,67,67,67,68,69,70,70,70,70,72,73,75,75,76,76,78,79,81)
damaged <- c(5,1,1,1,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0)
undamaged <- c(1,5,5,5,6,6,6,6,6,6,5,6,5,6,6,6,6,5,6,6,6,6,6)
mission <- seq(1:23)
space_dt <- data.frame(mission,temperature,damaged,undamaged)
space_dt
## mission temperature damaged undamaged
## 1 1 53 5 1
## 2 2 57 1 5
## 3 3 58 1 5
## 4 4 63 1 5
## 5 5 66 0 6
## 6 6 67 0 6
## 7 7 67 0 6
## 8 8 67 0 6
## 9 9 68 0 6
## 10 10 69 0 6
## 11 11 70 1 5
## 12 12 70 0 6
## 13 13 70 1 5
## 14 14 70 0 6
## 15 15 72 0 6
## 16 16 73 0 6
## 17 17 75 0 6
## 18 18 75 1 5
## 19 19 76 0 6
## 20 20 76 0 6
## 21 21 78 0 6
## 22 22 79 0 6
## 23 23 81 0 6
(a) The data provided in the previous exercise are shown in the plot. The logistic model fit to these data may be written as:
\(log_e(\frac{p_i}{1-p})=11.6630-0.2162Temperature\)
where p_hat is the model-estimated probability that an O-ring will become damaged. Use the model to calculate the probability that an O-ring will become damaged at each of the following ambient temperatures: 51, 53, and 55 degrees Fahrenheit. The model-estimated probabilities for several additional ambient temperatures are provided below, where subscripts indicate the temperature:
probs <- function(temp){
tempModel <- 11.6630-0.2162*temp
logitM <- exp(tempModel)/(1+exp(tempModel))
return(round(logitM,3))
}
tempLookup <- c(51,53,55,57,65,59,67,61,69,63,71)
probabilities <- probs(tempLookup)
probability that an O-ring will become damaged at 51 is:
probabilities[1]
## [1] 0.654
probability that an O-ring will become damaged at 53 is:
probabilities[2]
## [1] 0.551
probability that an O-ring will become damaged at 55 is:
probabilities[3]
## [1] 0.443
(b) Add the model-estimated probabilities from part (a) on the plot, then connect these dots using a smooth curve to represent the model-estimated probabilities.
ggplot(NULL,aes(x = tempLookup,y = probabilities))+geom_point()+geom_smooth(method = loess)
(c) Describe any concerns you may have regarding applying logistic regression in this application, and note any assumptions that are required to accept the model’s validity.
There are two key conditions for fitting a logistic regression model:
Each predictor xi is linearly related to logit(pi) if all other predictors are held constant. According to the data provided, there is a linearlity between the logit and the predictor variable.
space_prob <- probs(temperature)
space_dt <- space_dt %>% mutate(probabilities=space_prob,logit_prob=log(space_prob/(1-space_prob)))
titles <- c("logit_prob")
#logit transformation
space_dt %>% ggplot(aes(x = temperature,y = probabilities))+geom_point()+stat_smooth(method = lm)
space_dt %>% ggplot(aes(x = temperature,y = logit_prob))+geom_point()+stat_smooth(method = lm)
Each outcome Yi is independent of the other outcomes. The number of missions was 23, which is less than 30;Therefore, normality and independency are not assured.