class: center, middle, inverse, title-slide .title[ # des Données & des Chiffres ] .subtitle[ ## Gestion & Exploitation des données ] .author[ ### Philippe MICHEL ] .institute[ ### Réanimation médico-chirurgicale - USRC ] .date[ ### 2022-10-13 ] --- class: inverse, center, middle # Introduction --- # Du travail pour 5 ans… ![](images/etude1.png) --- # Du travail pour 5 ans… ![](images/etude2.png) --- class: inverse, center, middle # Avant le recueil --- # le Programme ## Écrire le protocole <BR> - Quelles données recueillir ? - Où & Comment les stocker ? - Nombre de sujets ? --- # Principes & Erreurs La science est reproductible : .large[**tout noter**] -- <BR> Pour gérer des données<BR> on utilise une **base de données** -- <BR> Quand techniquement ça se complique, <BR>on **sous-traite** --- # La science est reproductible ![](images/firm.png) <br> .lg[**40 000** articles invalidés] .right[ou 3 900 …] --- class: inverse, center, middle # des Variables --- # Les variables c'est simple ? <BR> ```r * sqrt(2)^2 == 2 ``` ``` ## [1] FALSE ``` -- <BR> ```r * sqrt(2)^2 - 2 ``` ``` ## [1] 4.440892e-16 ``` --- # Variables standards ## Numériques <BR> .pull-left[ #### Entiers RAS ] .pull-right[ ##### Décimaux L'enfer des arrondis !!! ] --- # Variables textuelles .pt[Longtemps, je me suis couché de bonne heure. Parfois, à peine ma bougie éteinte, mes yeux se fermaient si vite que je n’avais pas le temps de me dire : « Je m’endors. » Et, une demi-heure après, la pensée qu’il était temps de chercher le sommeil m’éveillait ; je voulais poser le volume que je croyais avoir encore dans les mains et souffler ma lumière ; je n’avais pas cessé en dormant de faire des réflexions sur ce que je venais de lire, mais ces réflexions avaient pris un tour un peu particulier ; il me semblait que j’étais moi-même ce dont parlait l’ouvrage : une église, un quatuor, la rivalité de François Ier et de Charles Quint. Cette croyance survivait pendant quelques secondes à mon réveil ; elle ne choquait pas ma raison mais pesait comme des écailles sur mes yeux et les empêchait de se rendre compte que le bougeoir n’était plus allumé. Puis elle commençait à me devenir inintelligible, comme après la métempsycose les pensées d’une existence antérieure ; le sujet du livre se détachait de moi, j’étais libre de m’y appliquer ou non ; aussitôt je recouvrais la vue et j’étais bien étonné de trouver autour de moi une obscurité, douce et reposante pour mes yeux, mais peut-être plus encore pour mon esprit, à qui elle apparaissait comme une chose sans cause, incompréhensible, comme une chose vraiment obscure.] --- # Variables textuelles simples ? <BR> - Oui - oui - OUI - oui_ --- # Variables discrètes <BR> .pull-left[ #### Non ordonnées - Blond - Brun - Chatain - Noir - Roux ] .pull-right[ #### Ordonnées **Échelle de Likert** - Un peu - Beaucoup - Passionnément - À la folie ] --- # Date & heure <BR> <table> <thead> <tr> <th style="text-align:left;"> Norme </th> <th style="text-align:left;"> Ecriture </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Français </td> <td style="text-align:left;"> 25/12/2022 </td> </tr> <tr> <td style="text-align:left;"> Français </td> <td style="text-align:left;"> 25/12/22 </td> </tr> <tr> <td style="text-align:left;"> USA </td> <td style="text-align:left;"> 12-25-2022 </td> </tr> <tr> <td style="text-align:left;"> ISO 8601 </td> <td style="text-align:left;"> 2022-12-25 </td> </tr> </tbody> </table> --- # Variables autres .pull-left[ - Texte brut - Images - Cartes - … ] .pull-right[ ![](images/chat.jpg) ] --- # Liste de Variables <table> <thead> <tr> <th style="text-align:left;"> nom </th> <th style="text-align:left;"> type </th> <th style="text-align:left;"> valeur </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Date d'admission </td> <td style="text-align:left;"> date </td> <td style="text-align:left;"> dd/mm/yyyy </td> </tr> <tr> <td style="text-align:left;"> Âge du patient </td> <td style="text-align:left;"> entier </td> <td style="text-align:left;"> 18 - 110 ans </td> </tr> <tr> <td style="text-align:left;"> Sexe </td> <td style="text-align:left;"> facteur </td> <td style="text-align:left;"> F/M </td> </tr> <tr> <td style="text-align:left;"> Poids </td> <td style="text-align:left;"> décimal </td> <td style="text-align:left;"> 30-200 Kg </td> </tr> <tr> <td style="text-align:left;"> IGS II à l’admission </td> <td style="text-align:left;"> entier </td> <td style="text-align:left;"> 6 - 150 </td> </tr> <tr> <td style="text-align:left;"> Oxygénothérapie </td> <td style="text-align:left;"> entier </td> <td style="text-align:left;"> 0 - 20 L/min </td> </tr> <tr> <td style="text-align:left;"> Ventilation invasive </td> <td style="text-align:left;"> facteur </td> <td style="text-align:left;"> oui/non </td> </tr> <tr> <td style="text-align:left;"> Sédation </td> <td style="text-align:left;"> facteur </td> <td style="text-align:left;"> oui/non </td> </tr> <tr> <td style="text-align:left;"> Curarisation </td> <td style="text-align:left;"> facteur </td> <td style="text-align:left;"> oui/non/NSP </td> </tr> </tbody> </table> --- # Variables… ### Questionnaire HTML .pull-left[ <p> Âge <input type ='NUMBER' name = 'age' min = '18' max = '110'> </p> ] .pull-right[ ### HTML ```{} <p> Âge <input type = 'NUMBER' name = 'age' min = '18' max = '110'> </p> ``` ] --- # Variables… ### R ```r *t.test(age~esc, var.equal = TRUE, data = tt) ``` ``` ## ## Two Sample t-test ## ## data: age by esc ## t = -2.6647, df = 1225, p-value = 0.007806 ## alternative hypothesis: true difference in means between group non and group oui is not equal to 0 ## 95 percent confidence interval: ## -5.479494 -0.832403 ## sample estimates: ## mean in group non mean in group oui ## 61.11245 64.26840 ``` --- class: inverse, center, middle # des Données --- layout: true background-image: url(images/fichier.jpg) background-size: cover --- # Stocker les données --- layout: false # Stocker les données ![](images/ecrf.png) --- # Où stocker ? .pull-left[ ##### Tableur - nb max de cas : 1 048 576 - Pas de sécurité à la saisie - Pas de sauvegarde intégrée - Format non standard - Travail collectif ? ] .pull-right[ #### Base de données <br> - Saisie simple (formulaire) - Saisie normée, contrôlée - Données sécurisées - Base centralisée, accessible à tous ] --- # Stockage des données en sécurité <BR> - **Technique** Café, Disque dur HS… - **Anonyme** Mais il faut pouvoir retrouver un dossier - **Accessible** À tous les centres mais que aux centres - **Conforme** CNIL… <br> .lg[**C'est un métier**] --- # Organiser son tableau ## Un grand rectangle <br> - Un seul tableau (*si possible*) - Variables en colonne, individus en ligne - Que les données, pas de calcul etc. - Une ligne de titre, titres uniques - Utilisez la validation de données --- # Titres, Sujets & Variables .center[![](images/tab1.png)] -- <BR> .center[![](images/tab2.png)] --- # Titres, Sujets & Variables .center[![](images/tab2.png)] ```r *t.test(Spo2_H1,SpO2_H2) ``` -- .center[![](images/tab3.png)] ```r *t.test(spo2~heure) ``` --- class: inverse, center, middle # Nombre de cas --- # Nombre de cas <BR> `$$n =\frac{(z_{(1-\mathbf{\alpha})}-z_{(1-\mathbf{\beta})})}{2(\arcsin\sqrt{P_{ref}}-\arcsin \sqrt{\color{red}{P_{nouveau}}})}$$` --- # du Nombre #### ISIS 2 Randomised trial of intravenous streptokinase, oral aspirin, both, or neither among **17,187 cases** of suspected acute myocardial infarction: ISIS-2 (Lancet 1988) *p < 0,00001* -- #### GUSTO I An International Randomized Trial Comparing Four Thrombolytic Strategies for Acute Myocardial Infarction (NEJM 1993) 41 000 cas (*p = 0,006*) --- ![](images/grippe1.png) --- ![](images/grippe2.png) --- # `\(p < 5 \%\)` ??? ![](images/pvalue1-1.png) --- # `\(p < 5 \%\)` ??? ![](images/pvalue2-1.png) --- # `\(p < 5 \%\)` ??? ![](images/pvalue3-1.png) --- class: inverse, center, middle # Recueil des Données --- ![](images/travail.jpg) --- ![](images/missing.jpeg) --- class: inverse, center, middle # Après le recueil --- # Le problème 164 180 187 180 180 170 **NA** 170 165 168 170 160 172 NA 169 160 **NA** 175 170 NA 155 172 150 **NA** 170 **NA** 175 180 NA 165 175 156 167 180 174 180 184 155 176 159 175 169 170 158 180 155 178 147 155 180 156 178 165 175 171 172 170 165 182 160 **NA** NA 160 160 155 174 182 182 170 180 163 **NA** 176 177 177 145 173 173 176 153 170 168 167 167 169 169 170 150 160 172 174 175 152 170 175 165 181 179 NA 173 182 177 177 181 181 160 155 155 175 191 174 172 170 172 183 165 166 155 183 170 170 185 180 170 170 170 170 180 165 156 180 172 173 170 180 163 172 170 173 170 166 163 175 164 156 175 175 166 164 170 181 172 165 163 167 170 170 173 163 177 172 165 163 162 180 162 165 155 175 165 165 159 175 175 170 175 180 160 162 170 170 170 175 180 158 165 185 175 175 152 165 165 162 162 175 170 158 158 168 173 160 180 175 176 175 153 180 157 162 150 165 171 168 180 170 170 170 180 170 170 169 180 170 172 185 172 175 186 168 171 180 174 165 170 180 162 175 161 178 170 168 165 176 163 160 171 150 160 165 175 168 170 185 175 175 184 153 158 189 162 170 150 175 178 170 186 170 178 170 165 175 170 168 175 162 176 180 176 156 169 165 160 185 184 179 170 150 **NA** 177 180 168 165 152 170 180 NA 171 176 160 177 170 150 165 160 175 172 NA 150 **NA** 170 **NA** 165 150 167 167 170 165 160 **NA** 175 165 160 170 166 165 185 165 175 182 170 175 162 **NA** 167 162 163 177 160 165 167 165 165 180 172 **NA** 170 147 173 174 **NA** 172 160 160 170 177 170 162 170 160 161 155 165 170 170 145 169 175 175 171 163 178 180 171 178 163 170 170 160 --- # Les stats servent à … .pull-left[ ![](images/pcinq.jpg) ] .pull-right[ - .lg[**Décrire sa population**] - Présenter les résultats - .pt[Faire des tests] ] --- # Il n'y a pas que `\(p<5\%\)` **Il faut décrire ses données !** <br> .pull-left[ <img src="donnees2_files/figure-html/sext-1.png" width="720" /> ] .pull-right[ #### Simple - Moyennes, écart-type - % ± Intervalle de confiance - Médiane, quartiles ] --- # Il n'y a pas que `\(p<5\%\)` .lg[**Il faut décrire ses données !**] <br> .pull-left[ ![](images/data5.png) ] .pull-right[ ##### Data mining - Clustering - Analyse factorielle - Deep Learning - Données textuelles - … ] --- # Du texte .center[![](images/mots1.png)] --- # Cartes ![](images/carte.jpg) --- # Cartes .center[![](images/echo.jpg)] --- # Des tests… .pull-left[ **Test simples** - t de Student - `\(\chi^2\)` - non paramétrique de Wilcoxon - ANOVA - Coefficient de corrélation (Spearman ou Pearson) - Cochran-Mantel-Haenszel - … ] .pull-right[ `$$s^2 =\sum_{x=1}^n\frac{(x_n-\bar{x})^2}{n-1}$$` `$$f(x)=\frac{1}{\sqrt{2\pi\sigma^{2}}}e^{\frac{-(x-\mu)^2}{2\sigma^{2}}}$$` `$$t^{n-1}_{1-\alpha/2}<\frac{|m_1-m_2|}{S^2\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}$$` `$$\xi_{CMH} = \frac{\big[{\sum_{i=1}^K (A_i - {N_{1i} M_{1i}\over T_i})\big]^2}} {\sum_{i=1}^K{N_{1i}N_{2i}M_{1i}M_{2i}\over T_i^2(T_i-1)}}$$` ] --- # Analyse monovariée <div style="border: 1px solid #ddd; padding: 0px; overflow-y: scroll; height:850px; overflow-x: scroll; width:100%; "><table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;border-bottom: 0;"> <caption>Tableau comparatif</caption> <thead> <tr> <th style="empty-cells: hide;border-bottom:hidden;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;" colspan="1"></th> <th style="border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: center; position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;" colspan="2"><div style="border-bottom: 1px solid #ddd; padding-bottom: 5px; ">Escarre</div></th> <th style="empty-cells: hide;border-bottom:hidden;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;" colspan="1"></th> </tr> <tr> <th style="text-align:left;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;"> </th> <th style="text-align:left;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;"> non </th> <th style="text-align:left;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;"> oui </th> <th style="text-align:left;position: sticky; top:0; background-color: #FFFFFF;position: sticky; top:0; background-color: #FFFFFF;"> p </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">alite.7.j.av</span> </td> <td style="text-align:left;"> </td> <td style="text-align:left;"> </td> <td style="text-align:left;"> < 0,001 </td> </tr> <tr> <td style="text-align:left;padding-left: 2em;" indentlevel="1"> non </td> <td style="text-align:left;"> 739/899 (82.2 \%) </td> <td style="text-align:left;"> 130/215 (60.5 \%) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;padding-left: 2em;" indentlevel="1"> oui </td> <td style="text-align:left;"> 160/899 (17.8 \%) </td> <td style="text-align:left;"> 85/215 (39.5 \%) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">age</span> </td> <td style="text-align:left;"> 61.1 ± 16.5 </td> <td style="text-align:left;"> 64.3 ± 14.8 </td> <td style="text-align:left;"> 0.008 </td> </tr> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">taille</span> </td> <td style="text-align:left;"> 169 ± 9.34 </td> <td style="text-align:left;"> 171 ± 9.57 </td> <td style="text-align:left;"> 0.011 </td> </tr> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">sexe</span> </td> <td style="text-align:left;"> </td> <td style="text-align:left;"> </td> <td style="text-align:left;"> 0.055 </td> </tr> <tr> <td style="text-align:left;padding-left: 2em;" indentlevel="1"> f </td> <td style="text-align:left;"> 318/924 (34.4 \%) </td> <td style="text-align:left;"> 59/214 (27.6 \%) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;padding-left: 2em;" indentlevel="1"> h </td> <td style="text-align:left;"> 606/924 (65.6 \%) </td> <td style="text-align:left;"> 155/214 (72.4 \%) </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">poids.ad</span> </td> <td style="text-align:left;"> 76.9 ± 19.3 </td> <td style="text-align:left;"> 80.6 ± 21.7 </td> <td style="text-align:left;"> 0.012 </td> </tr> <tr> <td style="text-align:left;"> <span style=" font-weight: bold; ">igs</span> </td> <td style="text-align:left;"> 40.8 ± 19.5 </td> <td style="text-align:left;"> 49.9 ± 19.4 </td> <td style="text-align:left;"> < 0,001 </td> </tr> </tbody> <tfoot> <tr><td style="padding: 0; " colspan="100%"><span style="font-style: italic;">Note: </span></td></tr> <tr><td style="padding: 0; " colspan="100%"> <sup></sup> moyenne ± ecart-type - nb/total (%) </td></tr> </tfoot> </table></div> --- # Des tests… **Analyses multivariées** #### Régressions - Linéaire - Logistique - Score de propension - … <BR> `$$PA=f(\alpha + \beta_1(\text{age})+\beta_2(\text{sexe})+\beta_3(\text{poids})+\epsilon)$$` --- # Analyse multivariée <img src="donnees2_files/figure-html/multi-1.png" width="720" /> --- # Un peu de recul… #### Forme simplifiée `$$IC_{1-\alpha}= p \pm z_{\alpha/2}\sqrt{\frac{p(1-p)}{n}}$$` <br> ##### Équation probabiliste `$$\mathbb{P}\left(-z_{\alpha/2} \leq \frac{\frac{X}{n}-p}{\sqrt{\frac{p(1-p)}{n}}} \leq z_{\alpha/2}\right)\thickapprox 1-\alpha$$` --- # Un peu de recul… `$$IC_{1-\alpha}= p \pm z_{\alpha/2}\sqrt{\frac{p(1-p)}{n}}$$` <br> ![](images/vingt.png) --- # Un peu de recul… ![](images/analyse.png) .right[R. Silberzahn,2018] --- # Un peu de recul… ![](images/analyse3.png) .right[R. Silberzahn,2018] --- # CONCLUSION ![](images/garbage.jpg) - **Qualité des données** - **Taille de l'échantillon** - **Du bon sens** - **Se méfier de tout** --- .center[.lg[**Il existe trois types de menteurs :**]] - .lg[**les menteurs**] - .lg[**les fieffés menteurs**] - .lg[** *&* les .red[statisticiens]**] \end{center