From dd7edc423e426066056750ff453d81a5ff946d8f Mon Sep 17 00:00:00 2001 From: Lyanis Souidi Date: Sun, 21 May 2023 23:19:27 +0200 Subject: [PATCH] [Ex4 - Q3] Ajout Co-authored-by: Dimitrijevic --- README.md | 2 ++ ex4/README.md | 28 ++++++++++++++++++++++++++++ ex4/img/ex4-3.png | Bin 0 -> 10678 bytes ex4/scripts/ex4-3.sce | 20 ++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 ex4/img/ex4-3.png create mode 100644 ex4/scripts/ex4-3.sce diff --git a/README.md b/README.md index 35875fe..9a94a5b 100644 --- a/README.md +++ b/README.md @@ -79,3 +79,5 @@ Les réponses aux questions des exercices sont situées dans les README des doss [![](https://cdn.discordapp.com/attachments/1063856358874689558/1109941195934814299/1.png)](ex4/#q1) [![](https://cdn.discordapp.com/attachments/1063856358874689558/1109941194202566696/2.png)](ex4/#q2) + +[![](https://cdn.discordapp.com/attachments/1063856358874689558/1109941194429055067/3.png)](ex4/#q3) diff --git a/ex4/README.md b/ex4/README.md index 13b5055..3ae5710 100644 --- a/ex4/README.md +++ b/ex4/README.md @@ -3,6 +3,7 @@ ## Table des matières 1. [Proportion de moins de 15 ans en fonction du taux de fécondité](#q1) 2. [Taux de mortalité infantile en fonction du taux de natalité](#q2) +3. [Taux de mortalité infantile en fonction du revenu](#q3) --- @@ -55,6 +56,33 @@ coefficient_correlation = correl(X,Y); Le coefficient de correlation, qui est à l'image du graphe obtenu, nous montre qu'il y à une causalité entre les deux. PLus le taux de natalité est élevé plus le taux de mortalité infantile est élevé, ce qui est logique. +--- + +### Question 3 : Taux de mortalité infantile en fonction du revenu {#q3} + +> Afficher le taux de mortalité infantile en fonction du revenu. Calculez le coefficent de corrélation. Que peut-on dire ? Y'a-t-il une relation de causalité entre les deux. + +**[Script Scilab](scripts/ex4-3.sce) :** + +```scilab +X = find(data(:,13)>=0); // Revenus + +XX = mtlb_t(data(X,13)); +YY = mtlb_t(data(X,7)); + +plot2d(XX,YY,-1); + +coefficient_correlation = correl(XX,YY) +``` + +**Résultat :** + +![Revenus en fonction du taux de mortalité infantile](img/ex4-3.png) + +- Coefficient de correlation : -0.60 + +On trouve donc une coefficient de correlation négatif de -60 globalement et cela montre un lien entre le revenus et le taux de martalité infantile, plus le revenus est élevé moins il y auras de mortalité infantile, ce qui est assez logique car un plus haut revenus sous entend un pays plus developpé. + --- diff --git a/ex4/img/ex4-3.png b/ex4/img/ex4-3.png new file mode 100644 index 0000000000000000000000000000000000000000..7eac56046afd945b12674f33744f72eb9689de08 GIT binary patch literal 10678 zcmaiac|6qH|Npehl5u6t($sAcLI_!=OH#s=!bnV}B>NV|IxT}K;ob^mZNs&jim?lW zG(y&~hmhSEyJ3FkJ-YXHm(TC}&)eheedc}6`}KOhp0DTYbb4`lpz>QD&Xv?UoPP~CwsVD#pbP-=$9V-7Pd)`^PyP5mKLw8 zC$EatJvo2#HQ(9&v-^@1eGI6LQJW28rEVoZtC-V`%^Q_I`DA<{3 zu=DyEPQ*zBx0g;#a8%1PRYJ(GIkJ0(7Fn#oi*~Qy8j<~YM~xPj>u&m!3%j~{)O!L; zipYy;FxdMCxJX?XY%c`{BM8G_+T5^{#7+OlEr$Yo@NM`O_Tc~f7O@=$4Tb|VK!Z1K z(}w$4Ykh`ABl$1s-QIlxFUaI}hiwF5Pez4rYq}uwU2bkrd+9=Mze?bsO2yZ&ueV*Q zm?ZZ}v}Ks{*Q<@h#UM@n{8srIdfdxQ)08Kr*J85Ge4?9~KF{z4G#r*tC7eEdEN!9h zy>T|fH*gA$Js%m_)L$7=$znFJ2z|^?ecWbO+=8}U(!R2(O5k%{U0oV4QD34g!Swlj z@v#PVrz+>NI0kyM>`qd$B@sbE&m)eH*C5y3aP#SylB={tW^E#2FaoLN*qyJyT%TqI zKFAwM@H=|T+dCxM%Ga*kX|U~GGYYBMlS~U3K~)~oqThF&tvwVH6%|#WvXGSQww}|$ z`mH9@$2Q*6G@rG;8XY&HpPb|>I?OudW;3UUpVPDJ9&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JO8;b~G z7Y+G9KvmEQxou5Mu%!H>rAq^@;N;Bf=UsrOst|%?TGc2qQQjXMK6{iURMh9!%SdpY z`>Yoo$HGRB^p!z&0M>O%9hLS<%z$w7=ix($CZJou8vj0C$R?40JOvbU+lIk{Rr;N1 VYUCzIf%BNKv${s7vb3+>{eRg22QvTw literal 0 HcmV?d00001 diff --git a/ex4/scripts/ex4-3.sce b/ex4/scripts/ex4-3.sce new file mode 100644 index 0000000..e5702b5 --- /dev/null +++ b/ex4/scripts/ex4-3.sce @@ -0,0 +1,20 @@ +data = csvRead("data.csv"); +// Pour réaliser la regression linaire du taux de mortalité infantile en fonction du taux du revenus +// on reprend le code la question précédente mais en utilisant les collones correspondantes + +X = find(data(:,13)>=0); // Revenus + +XX = mtlb_t(data(X,13)); +YY = mtlb_t(data(X,7)); + +plot2d(XX,YY,-1); +title("Revenus en fonction du taux de mortalité infantile"); +xlabel("Taux de mortalité infantile"); +ylabel("Revenus"); +xs2png(0,"ex4/img/ex4-3.png"); + +// Calcul de coefficient de correlation + +coefficient_correlation = correl(XX,YY); + +mprintf("Coefficient de correlation : %.2f \n",coefficient_correlation);