orings | R Documentation |
On January 28, 1986, a routine launch was anticipated for the Challenger space shuttle. Seventy-three seconds into the flight, disaster happened: the shuttle broke apart, killing all seven crew members on board. An investigation into the cause of the disaster focused on a critical seal called an O-ring, and it is believed that damage to these O-rings during a shuttle launch may be related to the ambient temperature during the launch. The table below summarizes observational data on O-rings for 23 shuttle missions, where the mission order is based on the temperature at the time of the launch.
orings
A data frame with 23 observations on the following 4 variables.
Shuttle mission number.
Temperature, in Fahrenheit.
Number of damaged O-rings (out of 6).
Number of undamaged O-rings (out of 6).
https://archive.ics.uci.edu/dataset/92/challenger+usa+space+shuttle+o+ring
library(dplyr)
library(forcats)
library(tidyr)
library(broom)
# This is a wide data frame. You can convert it to a long
# data frame to predict probability of O-ring damage based
# on temperature using logistic regression.
orings_long <- orings |>
pivot_longer(cols = c(damaged, undamaged), names_to = "outcome", values_to = "n") |>
uncount(n) |>
mutate(outcome = fct_relevel(outcome, "undamaged", "damaged"))
orings_mod <- glm(outcome ~ temperature, data = orings_long, family = "binomial")
tidy(orings_mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.