Statistiques descriptives des variables quantitatives

Data

Nous allons ici employer les données description :`

Pentes_HID <- read.csv2("C:/Users/mallah.s/Desktop/StatsTheses/These_Romane/Av_Ap/avec_HID/Pentes_HID.csv", stringsAsFactors=TRUE)

library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.0.5
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.2     v dplyr   1.0.7
## v tidyr   1.1.3     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.1
## Warning: package 'ggplot2' was built under R version 4.0.5
## Warning: package 'tibble' was built under R version 4.0.5
## Warning: package 'tidyr' was built under R version 4.0.5
## Warning: package 'dplyr' was built under R version 4.0.5
## Warning: package 'forcats' was built under R version 4.0.5
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
Pentes <-Pentes_HID %>% 
       pivot_longer(cols=c(Pente_0 ,Pente_1),names_to="periode" ,values_to = "Pente" )
 Pentes$periode<- fct_relevel(Pentes$periode, c("Pente_0" ,"Pente_1"))
 head(Pentes)
## # A tibble: 6 x 3
##   patient_ID periode  Pente
##   <fct>      <fct>    <dbl>
## 1 3_T        Pente_0 -0.083
## 2 3_T        Pente_1 -0.044
## 3 4_T        Pente_0 -0.03 
## 4 4_T        Pente_1 -0.026
## 5 5_T        Pente_0 -0.08 
## 6 5_T        Pente_1  0.048

schema évolution VEMS(ml) des patients

ggplot(Pentes , aes(x=periode, y=Pente, colour=patient_ID)) + 
      geom_point()+
       geom_line(aes(group=patient_ID))+
       theme_classic()+
       theme(legend.position = "none")

schema par patient

ggplot(Pentes, aes(x=periode, y=Pente, colour=patient_ID)) + 
    geom_point()+
    geom_line(aes(group=patient_ID))+
    theme_classic()+
    theme(legend.position = "none")+
    facet_wrap(~patient_ID)

##Calcul de la Difference

Pentes_HID$d <-Pentes_HID$Pente_0-Pentes_HID$Pente_1
head(Pentes_HID)
##   patient_ID Pente_0 Pente_1      d
## 1        3_T  -0.083  -0.044 -0.039
## 2        4_T  -0.030  -0.026 -0.004
## 3        5_T  -0.080   0.048 -0.128
## 4        8_T  -0.087  -0.060 -0.027
## 5       10_T  -0.037  -0.045  0.008
## 6       11_T  -0.042  -0.023 -0.019

Evaluation de la condition de validité

library(car)
## Warning: package 'car' was built under R version 4.0.5
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## The following object is masked from 'package:purrr':
## 
##     some
qqPlot(Pentes_HID$d)

## [1] 3 9

la normalité n’est pas globalement satisfaisante

shapiro.test(Pentes_HID$d)
## 
##  Shapiro-Wilk normality test
## 
## data:  Pentes_HID$d
## W = 0.92832, p-value = 0.01988

Le test de Shapiro-Wilk rejette l’hypothèse de normalité. Au final, nous n’ acceptons cette hypothèse. Nous faison donc un test de Wilcoxon

Test de Wilcoxon

wilcox.test(Pentes_HID$Pente_0, Pentes_HID$Pente_1, paired=TRUE)
## Warning in wilcox.test.default(Pentes_HID$Pente_0, Pentes_HID$Pente_1, paired =
## TRUE): cannot compute exact p-value with ties
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  Pentes_HID$Pente_0 and Pentes_HID$Pente_1
## V = 153.5, p-value = 0.002886
## alternative hypothesis: true location shift is not equal to 0