From 5c955cc15235d9b05970f2bb2d092ae5e1caa0b5 Mon Sep 17 00:00:00 2001 From: David Rei Date: Thu, 10 Jun 2021 11:53:44 +0200 Subject: [PATCH] maj exo5 --- module2/exo5/exo5_fr.Rmd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module2/exo5/exo5_fr.Rmd b/module2/exo5/exo5_fr.Rmd index ec9bf89..b0f7604 100644 --- a/module2/exo5/exo5_fr.Rmd +++ b/module2/exo5/exo5_fr.Rmd @@ -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 -- 2.18.1