STATISTIQUE2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Rapport

MF

20/12/2022
#importation des librairie

library(foreign)
library(haven)
library(dplyr)

##
## Attachement du package : 'dplyr'

## Les objets suivants sont masqués depuis 'package:stats':


##
## filter, lag

## Les objets suivants sont masqués depuis 'package:base':


##
## intersect, setdiff, setequal, union

library(questionr)
library(knitr)
library(skimr)
library(ggplot2)
library(ggalt)

## Registered S3 methods overwritten by 'ggalt':


## method from
## grid.draw.absoluteGrob ggplot2
## grobHeight.absoluteGrob ggplot2
## grobWidth.absoluteGrob ggplot2
## grobX.absoluteGrob ggplot2
## grobY.absoluteGrob ggplot2

library(labelled)
library(tidyverse)

## ── Attaching packages
## ───────────────────────────────────────
## tidyverse 1.3.2 ──

## ✔ tibble 3.1.8 ✔ purrr 0.3.4


## ✔ tidyr 1.2.0 ✔ stringr 1.4.1
## ✔ readr 2.1.2 ✔ forcats 0.5.1
## ── Conflicts ──────────────────────────────────────────
tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()

library(gtsummary)

## Warning: le package 'gtsummary' a été compilé avec la version R 4.2.2

#importation des donnés


a <- read_dta("D:/Base_EDS_2003_BF.dta")
##Présentation des résultats de l'analyse univaraiée
names(a)

## [1] "psu" "v002" "poid" "ageM" "region"


## [6] "milieu" "EducM" "Eaupotable" "toilette" "mat_sol"
## [11] "religionM" "tailleM" "occupationM" "sexeE" "durealait"
## [16] "rang_naiss" "rougeole" "Diarrhee" "ageE_Mois" "nivo_vie1"
## [21] "ethnieb"

a%>%tbl_summary(include = c("Diarrhee","sexeE" ,"ageE_Mois" ,"rougeole" ,


"EducM","nivo_vie1" ,"Eaupotable","toilette","mat_sol" ,"region",
"milieu"),missing = "no")

## ℹ Column(s) ageM, region, milieu, EducM, Eaupotable, toilette, mat_sol,


religionM, tailleM, occupationM, sexeE, durealait, rougeole, Diarrhee,
ageE_Mois, and nivo_vie1 are class "haven_labelled". This is an intermediate
datastructure not meant for analysis. Convert columns with
`haven::as_factor()`, `labelled::to_factor()`, `labelled::unlabelled()`, and
`unclass()`. "haven_labelled" value labels are ignored when columns are not
converted. Failure to convert may have unintended consequences or result in
error.
## • https://haven.tidyverse.org/articles/semantics.html
## •
https://larmarange.github.io/labelled/articles/intro_labelled.html#unlabelled
## Table printed with `knitr::kable()`, not {gt}. Learn why at
## https://www.danieldsjoberg.com/gtsummary/articles/rmarkdown.html
## To suppress this message, include `message = FALSE` in the code chunk
header.

Characteristic N = 15,044
Had diarrhea recently
0 11,590 (85%)
1 2,031 (15%)
Sex of child
1 7,647 (51%)
2 7,397 (49%)
Child’s age in months
0 769 (11%)
1 722 (11%)
Characteristic N = 15,044
2 1,394 (20%)
3 1,361 (20%)
4 1,339 (20%)
5 1,252 (18%)
Received MEASLES
0 3,825 (28%)
1 9,845 (72%)
Highest educational level
0 12,545 (83%)
1 1,684 (11%)
2 810 (5.4%)
RECODE of nivo_vie (Wealth index)
1 6,120 (41%)
2 3,298 (22%)
3 5,626 (37%)
Source of drinking water
1 11,280 (76%)
2 3,610 (24%)
Type of toilet facility
1 3,796 (25%)
2 11,098 (75%)
Main floor material
1 8,621 (58%)
2 6,271 (42%)
Region 7.0 (4.0, 10.0)
Type of place of residence
1 3,243 (22%)
2 11,801 (78%)
freq(a$region)

## n % val%
## [1] Boucle de Mouhoun 1352 9.0 9.0
## [2] Cascades 937 6.2 6.2
## [3] Centre 890 5.9 5.9
## [4] Centre-Est 1152 7.7 7.7
## [5] Centre-Nord 1122 7.5 7.5
## [6] Centre-Ouest 1335 8.9 8.9
## [7] Centre-Sud 946 6.3 6.3
## [8] Est 1532 10.2 10.2
## [9] Hauts Basins 1229 8.2 8.2
## [10] Nord 1189 7.9 7.9
## [11] Plateau Central 1019 6.8 6.8
## [12] Sahel 1260 8.4 8.4
## [13] Sud-Ouest 1081 7.2 7.2

table(a$region)

##
## 1 2 3 4 5 6 7 8 9 10 11 12 13
## 1352 937 890 1152 1122 1335 946 1532 1229 1189 1019 1260 1081

skim(a)

Data summary
Name a
Number of rows 15044
Number of columns 21
_______________________
Column type frequency:
numeric 21
________________________
Group variables None

Variable type: numeric

skim_vari n_miss complete_ p10 his


able ing rate mean sd p0 p25 p50 p75 0 t
psu 0 1.00 285.38 163.3 1 146 284 424 574 ▇
6 ▇



v002 0 1.00 15.51 8.59 1 8 16 23 30 ▇




poid 0 1.00 10219 43507 203 700 991 131 295 ▆
86.96 0.87 181 944 551 371 918 ▇
9 9 ▅


ageM 0 1.00 3.49 1.41 1 2 3 4 7 ▇
skim_vari n_miss complete_ p10 his
able ing rate mean sd p0 p25 p50 p75 0 t




region 0 1.00 7.07 3.70 1 4 7 10 13 ▇




milieu 0 1.00 1.78 0.41 1 2 2 2 2 ▂




EducM 5 1.00 0.22 0.53 0 0 0 0 2 ▇




Eaupotabl 154 0.99 1.24 0.43 1 1 1 1 2 ▇
e ▁



toilette 150 0.99 1.75 0.44 1 1 2 2 2 ▃




mat_sol 152 0.99 1.42 0.49 1 1 1 2 2 ▇




religionM 179 0.99 1.63 0.97 1 1 1 2 4 ▇




tailleM 0 1.00 1.86 0.73 1 1 2 2 3 ▆

skim_vari n_miss complete_ p10 his
able ing rate mean sd p0 p25 p50 p75 0 t



occupatio 76 0.99 2.09 1.15 0 1 3 3 3 ▃
nM ▁



sexeE 0 1.00 1.49 0.50 1 1 1 2 2 ▇




durealait 86 0.99 1.82 0.97 1 1 1 3 3 ▇




rang_nais 0 1.00 1.34 0.52 1 1 1 2 3 ▇
s ▁



rougeole 1374 0.91 0.72 0.45 0 0 1 1 1 ▃




Diarrhee 1423 0.91 0.15 0.36 0 0 0 0 1 ▇




ageE_Moi 8207 0.45 2.81 1.59 0 2 3 4 5 ▇
s ▇



nivo_vie1 0 1.00 1.97 0.88 1 1 2 3 3 ▇


skim_vari n_miss complete_ p10 his
able ing rate mean sd p0 p25 p50 p75 0 t


ethnieb 1457 0.90 4.20 1.71 1 3 5 5 7 ▂




table(a$EducM)

##
## 0 1 2
## 12545 1684 810

freq(a$ageM)

## n % val%
## [1] 15-19 673 4.5 4.5
## [2] 20-24 3550 23.6 23.6
## [3] 25-29 3962 26.3 26.3
## [4] 30-34 3285 21.8 21.8
## [5] 35-39 2130 14.2 14.2
## [6] 40-44 1127 7.5 7.5
## [7] 45-49 317 2.1 2.1

freq(a$Diarrhee)

## n % val%
## [0] N'a pas fait de diarrhée 11590 77.0 85.1
## [1] A fait la diarrhée 2031 13.5 14.9
## NA 1423 9.5 NA

#Représentation graphique
#diarrhée
barplot(table(a$Diarrhee),main = "Diarrhé",col = c("blue","pink"),xlab =
"Résultas",ylab = "Effectifs",space = 1)
#acces à l'eau potable
barplot(table(a$Eaupotable),main = "Accès à l'eau potable",col =
c("yellow","chocolate"),xlab = "Résultas",ylab = "Effectifs",space = 1)
#facilité d'acces aux toilettes
pie(table(a$toilette),labels = c("Acces à l'assainissement","N'a pas acces Ã
l'assainissement"),main = "Facilitées d'accès aux
toilettes",xlab="Résultas",ylab="Effectifs",col = c("red","blue"))

##Présentation des résultats de l'analyse bivaraiée et test de khi-2


a%>%tbl_summary(include = c("Diarrhee","sexeE" ,"ageE_Mois" ,"rougeole" ,
"EducM","nivo_vie1" ,"Eaupotable","toilette","mat_sol" ,"region",
"milieu"),missing = "no",by="Diarrhee",percent = "row")%>
%add_overall(last=TRUE)%>%add_p(test =list(all_continuous()~"chisq.test"))

## 1423 observations missing `Diarrhee` have been removed. To include these


observations, use `forcats::fct_explicit_na()` on `Diarrhee` column before
passing to `tbl_summary()`.
## ℹ Column(s) ageM, region, milieu, EducM, Eaupotable, toilette, mat_sol,
religionM, tailleM, occupationM, sexeE, durealait, rougeole, Diarrhee,
ageE_Mois, and nivo_vie1 are class "haven_labelled". This is an intermediate
datastructure not meant for analysis. Convert columns with
`haven::as_factor()`, `labelled::to_factor()`, `labelled::unlabelled()`, and
`unclass()`. "haven_labelled" value labels are ignored when columns are not
converted. Failure to convert may have unintended consequences or result in
error.
## • https://haven.tidyverse.org/articles/semantics.html
## •
https://larmarange.github.io/labelled/articles/intro_labelled.html#unlabelled
## ℹ Column(s) ageM, region, milieu, EducM, Eaupotable, toilette, mat_sol,
religionM, tailleM, occupationM, sexeE, durealait, rougeole, Diarrhee,
ageE_Mois, and nivo_vie1 are class "haven_labelled". This is an intermediate
datastructure not meant for analysis. Convert columns with
`haven::as_factor()`, `labelled::to_factor()`, `labelled::unlabelled()`, and
`unclass()`. "haven_labelled" value labels are ignored when columns are not
converted. Failure to convert may have unintended consequences or result in
error.
## • https://haven.tidyverse.org/articles/semantics.html
## •
https://larmarange.github.io/labelled/articles/intro_labelled.html#unlabelled
## Table printed with `knitr::kable()`, not {gt}. Learn why at
## https://www.danieldsjoberg.com/gtsummary/articles/rmarkdown.html
## To suppress this message, include `message = FALSE` in the code chunk
header.

Overall, N =
Characteristic 0, N = 11,590 1, N = 2,031 13,621 p-value
Sex of child 0.5
1 5,846 (85%) 1,041 (15%) 6,887 (100%)
2 5,744 (85%) 990 (15%) 6,734 (100%)
Child’s age in months <0.001
0 683 (89%) 86 (11%) 769 (100%)
1 566 (78%) 156 (22%) 722 (100%)
2 1,044 (75%) 347 (25%) 1,391 (100%)
3 1,097 (81%) 263 (19%) 1,360 (100%)
4 1,197 (90%) 140 (10%) 1,337 (100%)
5 1,176 (94%) 73 (5.8%) 1,249 (100%)
Received MEASLES 0.8
0 3,240 (85%) 565 (15%) 3,805 (100%)
1 8,306 (85%) 1,464 (15%) 9,770 (100%)
Highest educational level 0.004
0 9,648 (86%) 1,634 (14%) 11,282 (100%)
1 1,293 (82%) 276 (18%) 1,569 (100%)
2 645 (84%) 120 (16%) 765 (100%)
RECODE of nivo_vie 0.010
(Wealth index)
1 4,651 (86%) 771 (14%) 5,422 (100%)
2 2,567 (86%) 422 (14%) 2,989 (100%)
3 4,372 (84%) 838 (16%) 5,210 (100%)
Source of drinking water >0.9
1 8,755 (85%) 1,536 (15%) 10,291 (100%)
2 2,717 (85%) 475 (15%) 3,192 (100%)
Overall, N =
Characteristic 0, N = 11,590 1, N = 2,031 13,621 p-value
Type of toilet facility 0.2
1 2,984 (84%) 551 (16%) 3,535 (100%)
2 8,492 (85%) 1,460 (15%) 9,952 (100%)
Main floor material 0.036
1 6,564 (86%) 1,100 (14%) 7,664 (100%)
2 4,910 (84%) 911 (16%) 5,821 (100%)
Region 7.0 (4.0, 7.0 (4.0, 7.0 (4.0, 10.0) <0.001
10.0) 10.0)
Type of place of residence 0.4
1 2,557 (85%) 466 (15%) 3,023 (100%)
2 9,033 (85%) 1,565 (15%) 10,598 (100%)
#Geaphique correspondant au diristribution conditionnelles
#diarrhée&Région

barplot(cprop(table(a$Diarrhee,a$region),total = FALSE),main = "Survenue de


la Diarhée selon la Région",xlab = "Région",ylab = "Proportion",col =
c("red","blue"),legend=c("N'a pas fait diarrhée","A fais Diarrhée"),names.arg
= c("Boucle de Mouhoun","Cascades","Centre","Centre-Est","C-Nord","Centre-
Ouest","Centre-Sud","Est","H_Bassins","Nord","P-central","Sahel","S_Ouest"))
barplot(cprop(table(a$Diarrhee,a$nivo_vie1),total = FALSE),main = "Survenue
de la Diarhée selon le Niveau de vie du menage",xlab = "Région",ylab =
"Proportion",col = c("orangered","green"),legend = c("N'a pas fait
diarrhée","A fais Diarrhée"),names.arg = c("Pauvre","Moyen","Riche"))

barplot(cprop(table(a$Diarrhee,a$milieu),total = FALSE),main = "Survenue de


la Diarhée selon le milieu de résidence",xlab = "Région",ylab =
"Proportion",col = c("black","blue"),names.arg =
c("Urbain","Rural"),legend=c("N'a pas fait diarrhée","A fais Diarrhée"))

You might also like