Vous êtes sur la page 1sur 1

Y = 0 OR 1 EXAMPLE

So far we have looked only at examples where we had multiple success-failure outcomes at each combination of
levels of the explanatory variables. Often, particularly when the explanatory variable(s) are numeric and
observational, we may have only one outcome at each combination of the levels of the explanatory varaibles. In
these cases our response variable Y is either 0 ( failure ) or 1 ( success ).

O-Ring Data Problem 4.5 on pages 123 124 in the text.

Explanatory variable = temperature at time of launch of space shuttle

Response = 1 if at least one primary O-ring suffered thermal distress n = 23 launches before Challenger

> temperature <- c(66,70,69,68,67,72,73,70,57,63,70,78,67,53,67,75,70,81,76,79,75,76,58)


> y <- c(0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,1,0,1)
> logit.linear <- glm(y~temperature,family=binomial)
> summary(logit.linear)

Call:
glm(formula = y ~ temperature, family = binomial)

Deviance Residuals:
Min 1Q Median 3Q Max
-1.0611 -0.7613 -0.3783 0.4524 2.2175

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 15.0429 7.3786 2.039 0.0415 *
temperature -0.2322 0.1082 -2.145 0.0320 *

Null deviance: 28.267 on 22 degrees of freedom


Residual deviance: 20.315 on 21 degrees of freedom
AIC: 24.315

> cbind(temperature,fitted(logit.linear))
temperature
1 66 0.43049313
2 70 0.22996826
3 69 0.27362105
4 68 0.32209405
5 67 0.37472428
.
.
.
.
18 81 0.02270329
19 76 0.06904407
20 79 0.03564141
21 75 0.08554356
22 76 0.06904407
23 58 0.82884484

Vous aimerez peut-être aussi