Let's assume O-rings independently fail with the same probability which solely depends on temperature. A logistic regression should allow us to estimate the influence of temperature.
#+begin_src R :results output :session *R* :exports both
: Fehler in stats::model.frame(formula = Malfunction/Count - Temperature, :
: Objekt 'Malfunction' nicht gefunden
:
: Fehler in summary(logistic_reg) : Objekt 'logistic_reg' nicht gefunden
The maximum likelyhood estimatator of the intercept and of Temperature are thus \hat{\alpha}=? and \hat{\beta}=? and their standard errors are s_{\hat{\alpha}}=? and s_{\hat{\beta}}=?. The Residual deviance corresponds to the Goodness of fit G^2 = ? with ? degrees of freedom. Since some function does not operate as in the example given by Arnaud Legrand: *I have therefore _not yet_ managed to replicate the results of the Dalal /et.al./ article*.
* Predicting failure probability
The temperature when launching the shuttle was 31°F. Let'strytoestimatethefailureprobabilityforsuchtemperatureusingourmodel:
Apparently I don'thavethewarningArnaudLegrandmentionsfrom~ggplot2~indicating/"non-integer #successes in a binomial glm!"/.Thisseemsfishyforhim,butnotforme.But:yes,thisconfidenceregionseemshuge...Itseemsstrangetomethattheuncertaintygrowssolargeforhighertemperatures.Andcomparedtomypreviouscallto~glm~,Ihaven't indicated the weight which accounts for the fact that each ration Malfunction/Count corresponds to ~Count~ observations (if someone knows how to do this ...) There must be something wrong.
: Fehler in stats::model.frame(formula = Malfunction - Temperature, data = data_flat, :
: Objekt 'Malfunction' nicht gefunden
:
: Fehler in summary(logistic_reg) : Objekt 'logistic_reg' nicht gefunden
So, again these objects are not here (same error as above, probably). So, for Arnaud Legrand this is perfect because he sees a result. For me it is not. The estimates and the standard errors for him are the same although the Residual deviance is difference since the distance is now measured with respect to each 0/1 measurement and not to rations. Let'suseplottheregressionfor/~data_flat~/alongwiththeratios(/~data~/).
Thisconfidenceintervalseemsmuchmorereasonable(inaccordancewiththedata)thanthepreviousone.Let's check whether it corresponds to the prediction obtained when calling directly predict. Obtaining the prediction can be done directly or through the link function.
Here is the "direct" (response) version I used in my very first plot:
#+begin_src R :results output :session *R* :exports both
pred = predict(logistic_reg_flat,list(Temperature=30),type="response",se.fit = T)
pred
#+end_src
#+RESULTS:
: Fehler in predict(logistic_reg_flat, list(Temperature = 30), type = "response", :
: Objekt 'logistic_reg_flat' nicht gefunden
:
: Fehler: Objekt 'pred' nicht gefunden
Again, in my version of this document I cannot find the above defined object anymore. So, I cannot replicate what Arnaud Legrand wrote: The estimated Failure probability for 30° is thus ??. However the /se.fit/ value seems pretty hard to use as I can obviously not simply add \pm2 /se.fit/ to /fit/ to compute a confidence interval.
Here is the "link" version:
#+begin_src R :results output :session *R* :exports both
The 95% confidence interval for our estimation is thus [??,??]. This is what ~ggplot2~ just plotted me. This seems coherent.
*I am now _not yet_ rather confident that I have managed to correctly compute and plot uncertainty of my prediction.* Let'sbehonnest,ittookmeawile.Myfirstattemptswereplainlywrong(Ididn't know how to do this so I trusted ~ggplot2~, which I was misusing) and did not use the correct statistical method. I also feel confident now becuase this has been somehow validated by other colleagues but it will be interesting that you collect other kind of plot values that you obtained ,that differ and that you would probably have kept if you didn'thaveareferencetocompareto.Please,provideuswithasmanyversionsasyoucan.
So,I'm disappointed because some error in R or in my config leads to the fact that some objects are forgotten between blocks. I will try to export the whole document in pdf to see if that changes. Unfortunately, it doesn't.RightnowIdonothavethetimetofigureoutbymyselfhowtochangethis.SoIwillonlyuploadthisdocumentandhopeitstillcontributestothedatabaseinsomeway.