Upload exo 1 module 4

parent a930c008
---
title: "module4_exo1"
author: "Dusfour-Castan Pauline @433835ee939dd34ba5afd7c0a68da139"
output: pdf_document
date: "2025-09-04"
---
# Informations sur la version de R et les packages utlisés
```{r}
library(ggplot2)
library(readr)
sessionInfo()
```
# Importation des données et analyses
```{r}
data = read_csv("~/data_shuttle.csv")
data
```
```{r}
plot(data=data, Malfunction/Count ~ Temperature, ylim=c(0,1))
```
## Régression Logistique
```{r}
logistic_reg = glm(data=data, Malfunction/Count ~ Temperature, weights=Count,
family=binomial(link='logit'))
summary(logistic_reg)
```
## Prédire la probabilité de défaillance
```{r}
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)
```
```{r, fig.height=3.3}
ggplot(data, aes(y=Malfunction/Count, x=Temperature)) +
geom_point(alpha=.2, size = 2, color="blue") +
geom_smooth(method = "glm", method.args = list(family = "binomial"), fullrange=T) +
xlim(30,90) + ylim(0,1) + theme_bw()
```
\ No newline at end of file
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