Commit 5c955cc1 authored by David Rei's avatar David Rei

maj exo5

parent 25a572b4
......@@ -28,6 +28,7 @@ Nous commençons donc par charger ces données:
```{r}
data = read.csv("shuttle.csv",header=T)
data2 = read.csv("shuttle.csv",header=T)
dataClean = read.csv("shuttle.csv",header=T)
data
```
......@@ -57,7 +58,9 @@ simplifier l'analyse.
Comment la fréquence d'échecs varie-t-elle avec la température ?
```{r}
plot(data=data, Malfunction/Count ~ Temperature, ylim=c(0,1))
plot(data=dataClean, Malfunction/Count ~ Temperature, ylim=c(0,1))
plot(data=data, Pressure ~ Temperature, ylim=c(0,200))
plot(data=dataClean, Pressure ~ Temperature, ylim=c(0,200))
plot(data=data2, Pressure ~ Temperature, ylim=c(0,200), xlim=c(60, 85))
```
......@@ -79,6 +82,10 @@ régression logistique.
logistic_reg = glm(data=data, Malfunction/Count ~ Temperature, weights=Count,
family=binomial(link='logit'))
summary(logistic_reg)
logistic_reg2 = glm(data=data2, Malfunction/Count ~ Temperature, weights=Count,
family=binomial(link='logit'))
summary(logistic_reg2)
```
L'estimateur le plus probable du paramètre de température est 0.001416
......@@ -97,6 +104,7 @@ tempv = seq(from=30, to=90, by = .5)
rmv <- predict(logistic_reg,list(Temperature=tempv),type="response")
plot(tempv,rmv,type="l",ylim=c(0,1))
points(data=data, Malfunction/Count ~ Temperature)
```
Comme on pouvait s'attendre au vu des données initiales, la
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment