From 3b66beeed00e48801c1b8aba6b26a8771f68777f Mon Sep 17 00:00:00 2001 From: David Elser Date: Fri, 5 Mar 2021 15:31:39 +0100 Subject: [PATCH] first try --- module2/exo5/exo5_en.Rmd | 17 ++++++++++++++++- .../exo1/influenza-like-illness-analysis.Rmd | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/module2/exo5/exo5_en.Rmd b/module2/exo5/exo5_en.Rmd index f9003e3..6ef5d66 100644 --- a/module2/exo5/exo5_en.Rmd +++ b/module2/exo5/exo5_en.Rmd @@ -35,13 +35,28 @@ The data set shows us the date of each test, the number of O-rings temperature (in Fahrenheit) and pressure (in psi), and finally the number of identified malfunctions. + +```{r} +library(ggplot2) +ggplot (data,aes(x=Temperature,y=Malfunction))+geom_point(alpha=.3,size=3) + + theme_bw() + + geom_smooth(method = "glm", + method.args=list(family="binomial")) +xlim(40,100) + +``` + # Graphical inspection Flights without incidents do not provide any information on the influence of temperature or pressure on malfunction. We thus focus on the experiments in which at least one O-ring was defective. ```{r} -data = data[data$Malfunction>0,] +data = data[(data$Malfunction == "0" |data$Malfunction=="1"),] +library(ggplot2) +ggplot (data,aes(x=Temperature,y=Malfunction))+geom_point(alpha=.3,size=3) + + theme_bw() + + geom_smooth(method = "glm", + method.args=list(family="binomial")) +xlim(40,100) data ``` diff --git a/module3/exo1/influenza-like-illness-analysis.Rmd b/module3/exo1/influenza-like-illness-analysis.Rmd index 8047fa0..7d178be 100644 --- a/module3/exo1/influenza-like-illness-analysis.Rmd +++ b/module3/exo1/influenza-like-illness-analysis.Rmd @@ -45,6 +45,7 @@ This is the documentation of the data from [the download site](https://ns.sentiw The first line of the CSV file is a comment, which we ignore with `skip=1`. ```{r} +data_url="https://www.sentiweb.fr/datasets/incidence-PAY-3.csv" data = read.csv(data_url, skip=1) ``` @@ -58,6 +59,7 @@ Are there missing data points? ```{r} na_records = apply(data, 1, function (x) any(is.na(x))) data[na_records,] + ``` The two relevant columns for us are `week` and `inc`. Let's verify their classes: -- 2.18.1