{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Analysis of the risk of failure of the O-rings on the Challenger shuttle"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On January 27, 1986, the day before the takeoff of the shuttle _Challenger_, had\n",
    "a three-hour teleconference was held between \n",
    "Morton Thiokol (the manufacturer of one of the engines) and NASA. The\n",
    "discussion focused on the consequences of the\n",
    "temperature at take-off of 31°F (just below\n",
    "0°C) for the success of the flight and in particular on the performance of the\n",
    "O-rings used in the engines. Indeed, no test\n",
    "had been performed at this temperature.\n",
    "\n",
    "The following study takes up some of the analyses carried out that\n",
    "night with the objective of assessing the potential influence of\n",
    "the temperature and pressure to which the O-rings are subjected\n",
    "on their probability of malfunction. Our starting point is \n",
    "the results of the experiments carried out by NASA engineers\n",
    "during the six years preceding the launch of the shuttle\n",
    "Challenger."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loading the data\n",
    "We start by loading this data:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<caption>A data.frame: 23 × 5</caption>\n",
       "<thead>\n",
       "\t<tr><th scope=col>Date</th><th scope=col>Count</th><th scope=col>Temperature</th><th scope=col>Pressure</th><th scope=col>Malfunction</th></tr>\n",
       "\t<tr><th scope=col>&lt;fct&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "\t<tr><td>4/12/81  </td><td>6</td><td>66</td><td> 50</td><td>0</td></tr>\n",
       "\t<tr><td>11/12/81 </td><td>6</td><td>70</td><td> 50</td><td>1</td></tr>\n",
       "\t<tr><td>3/22/82  </td><td>6</td><td>69</td><td> 50</td><td>0</td></tr>\n",
       "\t<tr><td>11/11/82 </td><td>6</td><td>68</td><td> 50</td><td>0</td></tr>\n",
       "\t<tr><td>4/04/83  </td><td>6</td><td>67</td><td> 50</td><td>0</td></tr>\n",
       "\t<tr><td>6/18/82  </td><td>6</td><td>72</td><td> 50</td><td>0</td></tr>\n",
       "\t<tr><td>8/30/83  </td><td>6</td><td>73</td><td>100</td><td>0</td></tr>\n",
       "\t<tr><td>11/28/83 </td><td>6</td><td>70</td><td>100</td><td>0</td></tr>\n",
       "\t<tr><td>2/03/84  </td><td>6</td><td>57</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><td>4/06/84  </td><td>6</td><td>63</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><td>8/30/84  </td><td>6</td><td>70</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><td>10/05/84 </td><td>6</td><td>78</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>11/08/84 </td><td>6</td><td>67</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>1/24/85  </td><td>6</td><td>53</td><td>200</td><td>2</td></tr>\n",
       "\t<tr><td>4/12/85  </td><td>6</td><td>67</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>4/29/85  </td><td>6</td><td>75</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>6/17/85  </td><td>6</td><td>70</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>7/29/85</td><td>6</td><td>81</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>8/27/85  </td><td>6</td><td>76</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>10/03/85 </td><td>6</td><td>79</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>10/30/85 </td><td>6</td><td>75</td><td>200</td><td>2</td></tr>\n",
       "\t<tr><td>11/26/85 </td><td>6</td><td>76</td><td>200</td><td>0</td></tr>\n",
       "\t<tr><td>1/12/86  </td><td>6</td><td>58</td><td>200</td><td>1</td></tr>\n",
       "</tbody>\n",
       "</table>\n"
      ],
      "text/latex": [
       "A data.frame: 23 × 5\n",
       "\\begin{tabular}{r|lllll}\n",
       " Date & Count & Temperature & Pressure & Malfunction\\\\\n",
       " <fct> & <int> & <int> & <int> & <int>\\\\\n",
       "\\hline\n",
       "\t 4/12/81   & 6 & 66 &  50 & 0\\\\\n",
       "\t 11/12/81  & 6 & 70 &  50 & 1\\\\\n",
       "\t 3/22/82   & 6 & 69 &  50 & 0\\\\\n",
       "\t 11/11/82  & 6 & 68 &  50 & 0\\\\\n",
       "\t 4/04/83   & 6 & 67 &  50 & 0\\\\\n",
       "\t 6/18/82   & 6 & 72 &  50 & 0\\\\\n",
       "\t 8/30/83   & 6 & 73 & 100 & 0\\\\\n",
       "\t 11/28/83  & 6 & 70 & 100 & 0\\\\\n",
       "\t 2/03/84   & 6 & 57 & 200 & 1\\\\\n",
       "\t 4/06/84   & 6 & 63 & 200 & 1\\\\\n",
       "\t 8/30/84   & 6 & 70 & 200 & 1\\\\\n",
       "\t 10/05/84  & 6 & 78 & 200 & 0\\\\\n",
       "\t 11/08/84  & 6 & 67 & 200 & 0\\\\\n",
       "\t 1/24/85   & 6 & 53 & 200 & 2\\\\\n",
       "\t 4/12/85   & 6 & 67 & 200 & 0\\\\\n",
       "\t 4/29/85   & 6 & 75 & 200 & 0\\\\\n",
       "\t 6/17/85   & 6 & 70 & 200 & 0\\\\\n",
       "\t 7/29/85 & 6 & 81 & 200 & 0\\\\\n",
       "\t 8/27/85   & 6 & 76 & 200 & 0\\\\\n",
       "\t 10/03/85  & 6 & 79 & 200 & 0\\\\\n",
       "\t 10/30/85  & 6 & 75 & 200 & 2\\\\\n",
       "\t 11/26/85  & 6 & 76 & 200 & 0\\\\\n",
       "\t 1/12/86   & 6 & 58 & 200 & 1\\\\\n",
       "\\end{tabular}\n"
      ],
      "text/markdown": [
       "\n",
       "A data.frame: 23 × 5\n",
       "\n",
       "| Date &lt;fct&gt; | Count &lt;int&gt; | Temperature &lt;int&gt; | Pressure &lt;int&gt; | Malfunction &lt;int&gt; |\n",
       "|---|---|---|---|---|\n",
       "| 4/12/81   | 6 | 66 |  50 | 0 |\n",
       "| 11/12/81  | 6 | 70 |  50 | 1 |\n",
       "| 3/22/82   | 6 | 69 |  50 | 0 |\n",
       "| 11/11/82  | 6 | 68 |  50 | 0 |\n",
       "| 4/04/83   | 6 | 67 |  50 | 0 |\n",
       "| 6/18/82   | 6 | 72 |  50 | 0 |\n",
       "| 8/30/83   | 6 | 73 | 100 | 0 |\n",
       "| 11/28/83  | 6 | 70 | 100 | 0 |\n",
       "| 2/03/84   | 6 | 57 | 200 | 1 |\n",
       "| 4/06/84   | 6 | 63 | 200 | 1 |\n",
       "| 8/30/84   | 6 | 70 | 200 | 1 |\n",
       "| 10/05/84  | 6 | 78 | 200 | 0 |\n",
       "| 11/08/84  | 6 | 67 | 200 | 0 |\n",
       "| 1/24/85   | 6 | 53 | 200 | 2 |\n",
       "| 4/12/85   | 6 | 67 | 200 | 0 |\n",
       "| 4/29/85   | 6 | 75 | 200 | 0 |\n",
       "| 6/17/85   | 6 | 70 | 200 | 0 |\n",
       "| 7/29/85 | 6 | 81 | 200 | 0 |\n",
       "| 8/27/85   | 6 | 76 | 200 | 0 |\n",
       "| 10/03/85  | 6 | 79 | 200 | 0 |\n",
       "| 10/30/85  | 6 | 75 | 200 | 2 |\n",
       "| 11/26/85  | 6 | 76 | 200 | 0 |\n",
       "| 1/12/86   | 6 | 58 | 200 | 1 |\n",
       "\n"
      ],
      "text/plain": [
       "   Date      Count Temperature Pressure Malfunction\n",
       "1  4/12/81   6     66           50      0          \n",
       "2  11/12/81  6     70           50      1          \n",
       "3  3/22/82   6     69           50      0          \n",
       "4  11/11/82  6     68           50      0          \n",
       "5  4/04/83   6     67           50      0          \n",
       "6  6/18/82   6     72           50      0          \n",
       "7  8/30/83   6     73          100      0          \n",
       "8  11/28/83  6     70          100      0          \n",
       "9  2/03/84   6     57          200      1          \n",
       "10 4/06/84   6     63          200      1          \n",
       "11 8/30/84   6     70          200      1          \n",
       "12 10/05/84  6     78          200      0          \n",
       "13 11/08/84  6     67          200      0          \n",
       "14 1/24/85   6     53          200      2          \n",
       "15 4/12/85   6     67          200      0          \n",
       "16 4/29/85   6     75          200      0          \n",
       "17 6/17/85   6     70          200      0          \n",
       "18 7/29/85 6     81          200      0          \n",
       "19 8/27/85   6     76          200      0          \n",
       "20 10/03/85  6     79          200      0          \n",
       "21 10/30/85  6     75          200      2          \n",
       "22 11/26/85  6     76          200      0          \n",
       "23 1/12/86   6     58          200      1          "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = read.csv(\"shuttle.csv\",header=T)\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The data set shows us the date of each test, the number of O-rings (there are 6 on the main launcher), the temperature (in Fahrenheit) and pressure (in psi), and finally the number of identified malfunctions."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Graphical inspection\n",
    "Flights without incidents do not provide any information\n",
    "on the influence of temperature or pressure on malfunction.\n",
    "We thus focus on the experiments in which at least one O-ring\n",
    "was defective."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table>\n",
       "<caption>A data.frame: 7 × 5</caption>\n",
       "<thead>\n",
       "\t<tr><th></th><th scope=col>Date</th><th scope=col>Count</th><th scope=col>Temperature</th><th scope=col>Pressure</th><th scope=col>Malfunction</th></tr>\n",
       "\t<tr><th></th><th scope=col>&lt;fct&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th><th scope=col>&lt;int&gt;</th></tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "\t<tr><th scope=row>2</th><td>11/12/81</td><td>6</td><td>70</td><td> 50</td><td>1</td></tr>\n",
       "\t<tr><th scope=row>9</th><td>2/03/84 </td><td>6</td><td>57</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><th scope=row>10</th><td>4/06/84 </td><td>6</td><td>63</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><th scope=row>11</th><td>8/30/84 </td><td>6</td><td>70</td><td>200</td><td>1</td></tr>\n",
       "\t<tr><th scope=row>14</th><td>1/24/85 </td><td>6</td><td>53</td><td>200</td><td>2</td></tr>\n",
       "\t<tr><th scope=row>21</th><td>10/30/85</td><td>6</td><td>75</td><td>200</td><td>2</td></tr>\n",
       "\t<tr><th scope=row>23</th><td>1/12/86 </td><td>6</td><td>58</td><td>200</td><td>1</td></tr>\n",
       "</tbody>\n",
       "</table>\n"
      ],
      "text/latex": [
       "A data.frame: 7 × 5\n",
       "\\begin{tabular}{r|lllll}\n",
       "  & Date & Count & Temperature & Pressure & Malfunction\\\\\n",
       "  & <fct> & <int> & <int> & <int> & <int>\\\\\n",
       "\\hline\n",
       "\t2 & 11/12/81 & 6 & 70 &  50 & 1\\\\\n",
       "\t9 & 2/03/84  & 6 & 57 & 200 & 1\\\\\n",
       "\t10 & 4/06/84  & 6 & 63 & 200 & 1\\\\\n",
       "\t11 & 8/30/84  & 6 & 70 & 200 & 1\\\\\n",
       "\t14 & 1/24/85  & 6 & 53 & 200 & 2\\\\\n",
       "\t21 & 10/30/85 & 6 & 75 & 200 & 2\\\\\n",
       "\t23 & 1/12/86  & 6 & 58 & 200 & 1\\\\\n",
       "\\end{tabular}\n"
      ],
      "text/markdown": [
       "\n",
       "A data.frame: 7 × 5\n",
       "\n",
       "| <!--/--> | Date &lt;fct&gt; | Count &lt;int&gt; | Temperature &lt;int&gt; | Pressure &lt;int&gt; | Malfunction &lt;int&gt; |\n",
       "|---|---|---|---|---|---|\n",
       "| 2 | 11/12/81 | 6 | 70 |  50 | 1 |\n",
       "| 9 | 2/03/84  | 6 | 57 | 200 | 1 |\n",
       "| 10 | 4/06/84  | 6 | 63 | 200 | 1 |\n",
       "| 11 | 8/30/84  | 6 | 70 | 200 | 1 |\n",
       "| 14 | 1/24/85  | 6 | 53 | 200 | 2 |\n",
       "| 21 | 10/30/85 | 6 | 75 | 200 | 2 |\n",
       "| 23 | 1/12/86  | 6 | 58 | 200 | 1 |\n",
       "\n"
      ],
      "text/plain": [
       "   Date     Count Temperature Pressure Malfunction\n",
       "2  11/12/81 6     70           50      1          \n",
       "9  2/03/84  6     57          200      1          \n",
       "10 4/06/84  6     63          200      1          \n",
       "11 8/30/84  6     70          200      1          \n",
       "14 1/24/85  6     53          200      2          \n",
       "21 10/30/85 6     75          200      2          \n",
       "23 1/12/86  6     58          200      1          "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = data[data$Malfunction>0,]\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We have a high temperature variability but\n",
    "the pressure is almost always 200, which should\n",
    "simplify the analysis.\n",
    "\n",
    "How does the frequency of failure vary with temperature?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAC+lBMVEUAAAABAQECAgIDAwME\nBAQFBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUW\nFhYXFxcYGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJycp\nKSkqKiorKystLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6Ojo7Ozs8\nPDw9PT0+Pj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tMTExNTU1O\nTk5PT09QUFBRUVFSUlJTU1NUVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1eXl5fX19g\nYGBhYWFiYmJjY2NkZGRlZWVmZmZnZ2doaGhpaWlqampra2tsbGxtbW1ubm5vb29wcHBxcXFy\ncnJzc3N0dHR1dXV2dnZ3d3d4eHh5eXl6enp7e3t8fHx9fX1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ze1r3L2Wucmzv12nHohx26PuU4D5/eoefULwpGNmxpdCWoEZI9JpiPgx4Bfw8h2YOQ\nQoyQ7EFIIUZI9iCkECMkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAk\nQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgT+P9FRuQB/\nRTZ+AAAAAElFTkSuQmCC",
      "text/plain": [
       "plot without title"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot(data=data, Malfunction/Count ~ Temperature, ylim=c(0,1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "At first glance, the dependence does not look very important, but let's try to\n",
    "estimate the impact of temperature $t$ on the probability of O-ring malfunction."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Estimation of the temperature influence\n",
    "\n",
    "Suppose that each of the six O-rings is damaged with the same\n",
    "probability and independently of the others and that this probability\n",
    "depends only on the temperature. If $p(t)$ is this probability, the\n",
    "number $D$ of malfunctioning O-rings during a flight at\n",
    "temperature $t$ follows a binomial law with parameters $n=6$ and\n",
    "$p=p(t)$. To link $p(t)$ to $t$, we will therefore perform a\n",
    "logistic regression."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\n",
       "Call:\n",
       "glm(formula = Malfunction/Count ~ Temperature, family = binomial(link = \"logit\"), \n",
       "    data = data, weights = Count)\n",
       "\n",
       "Deviance Residuals: \n",
       "      2        9       10       11       14       21       23  \n",
       "-0.3015  -0.2836  -0.2919  -0.3015   0.6891   0.6560  -0.2850  \n",
       "\n",
       "Coefficients:\n",
       "             Estimate Std. Error z value Pr(>|z|)\n",
       "(Intercept) -1.389528   3.195752  -0.435    0.664\n",
       "Temperature  0.001416   0.049773   0.028    0.977\n",
       "\n",
       "(Dispersion parameter for binomial family taken to be 1)\n",
       "\n",
       "    Null deviance: 1.3347  on 6  degrees of freedom\n",
       "Residual deviance: 1.3339  on 5  degrees of freedom\n",
       "AIC: 18.894\n",
       "\n",
       "Number of Fisher Scoring iterations: 4\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "logistic_reg = glm(data=data, Malfunction/Count ~ Temperature, weights=Count, \n",
    "                   family=binomial(link='logit'))\n",
    "summary(logistic_reg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The most likely estimator of the temperature parameter is 0.0014\n",
    "and the standard error of this estimator is 0.122, in other words we\n",
    "cannot distinguish any particular impact and we must take our\n",
    "estimates with caution."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Estimation of the probability of O-ring malfunction\n",
    "\n",
    "The expected temperature on the take-off day is 31°F. Let's try to\n",
    "estimate the probability of O-ring malfunction at\n",
    "this temperature from the model we just built:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAC/VBMVEUAAAABAQECAgIDAwME\nBAQFBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUW\nFhYXFxcYGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJyco\nKCgpKSkqKiorKyssLCwtLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6\nOjo7Ozs8PDw9PT0+Pj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tM\nTExNTU1OTk5PT09QUFBRUVFSUlJTU1NUVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1e\nXl5fX19gYGBhYWFiYmJjY2NkZGRlZWVmZmZnZ2doaGhpaWlqampra2tsbGxtbW1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EBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQI\nEBIgQEiAACEBAoQECBASIEBIgAAhAQKElP1uqUx6BWgUIWW9DeaJpJeARhFS1nuMkDxASNnu\n2ybl+SD4aGLv/C4j7N8yH22qJ3RrfeLL20p6tjmpIvWFs82G8d1afunOIDg55wN7mfU5QxJd\n80GIkLLdixebqQs3B5uKOpTO/+nhBc8EwRgz7MZX7mvV+6zSZQs6dt8VBKPMCaVLnv+mmRfM\nMXfYy9xm5ia97IMNIWW9W8KHdpfnLU2drmv3tSAYby5PHY4056VOS8wSG9Lo1OEnBX2CTXlD\n7UVOKqhOcMEHJULKemFIdV0GfGidbj5LhVSe+vL1Zn7q9E6zwIb0mB04zGwIzsjdaB/ZnZPs\nkg9ChJT1wpA+Mnu9mQppZerL08zTqdN55j9tSKvswDHmleB+80v7yK4s2SUfhAgp64UhVZr+\nT6RVp0KybyxNs69A7A3pPTtwYiqtLa1PSz2y61ST7JIPQoSU9fb8i9S//gv7Ccn+ExV8z7wW\nBOflVa3PmZDQUg9ihJT10i82dGkVvn6wKdhvSI/a751gUt8tM/NvM88lt9qDFSFlvZnhM57L\nzXWp0009ztpvSN9OHa7O+VLqdGeHC08pqktyvQcnQsp6C8wJP/9zsLG3ueS+n/bOf2q/IQ07\n6647+5iH7PBLOuddl+yCD0qElPV2ndu602+C4MPLe+V1/M7LwX5DqvxBz5bH3BcOf8qknzHB\nKUJqBkaZ9Ukv4aBHSM0AISWPkJoBQkoeITUDhJQ8QgIECAkQICRAgJAAAUICBAgJECAkQICQ\nAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAAB\nQgIECAkQICRA4H8AHOKqM1UAAAADSURBVHhzjEM0knQAAAAASUVORK5CYII=",
      "text/plain": [
       "plot without title"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "tempv = seq(from=30, to=90, by = .5)\n",
    "rmv <- predict(logistic_reg,list(Temperature=tempv),type=\"response\")\n",
    "plot(tempv,rmv,type=\"l\",ylim=c(0,1))\n",
    "points(data=data, Malfunction/Count ~ Temperature)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "hideCode": false,
    "hidePrompt": false,
    "scrolled": true
   },
   "source": [
    "As expected from the initial data, the\n",
    "temperature has no significant impact on the probability of failure of the\n",
    "O-rings. It will be about 0.2, as in the tests\n",
    "where we had a failure of at least one joint. Let's get back\n",
    "to the initial dataset to estimate the probability of failure:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "0.0652173913043478"
      ],
      "text/latex": [
       "0.0652173913043478"
      ],
      "text/markdown": [
       "0.0652173913043478"
      ],
      "text/plain": [
       "[1] 0.06521739"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data_full = read.csv(\"shuttle.csv\",header=T)\n",
    "sum(data_full$Malfunction)/sum(data_full$Count)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This probability is thus about $p=0.065$. Knowing that there is\n",
    "a primary and a secondary O-ring on each of the three parts of the\n",
    "launcher, the probability of failure of both joints of a launcher\n",
    "is $p^2 \\approx 0.00425$. The probability of failure of any one of the\n",
    "launchers is $1-(1-p^2)^3 \\approx 1.2\\%$.  That would really be\n",
    "bad luck.... Everything is under control, so the takeoff can happen\n",
    "tomorrow as planned.\n",
    "\n",
    "But the next day, the Challenger shuttle exploded and took away\n",
    "with her the seven crew members. The public was shocked and in\n",
    "the subsequent investigation, the reliability of the\n",
    "O-rings was questioned. Beyond the internal communication problems\n",
    "of NASA, which have a lot to do with this fiasco, the previous analysis\n",
    "includes (at least) a small problem.... Can you find it?\n",
    "You are free to modify this analysis and to look at this dataset\n",
    "from all angles in order to to explain what's wrong."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Hide code",
  "kernelspec": {
   "display_name": "R",
   "language": "R",
   "name": "ir"
  },
  "language_info": {
   "codemirror_mode": "r",
   "file_extension": ".r",
   "mimetype": "text/x-r-source",
   "name": "R",
   "pygments_lexer": "r",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
