class: center, middle, inverse, title-slide # Pourquoi des stats ? ## avec des équations dedans|hellip; ### Philippe MICHEL ### 2021-01-22 --- --- # Des variables --- # une Idée, une Question ## Devenir des BPCO vus aux urgences ## une interrogation Quel BPCO doit être hospitalisé en réa ? ##un critère SIMPLE Hospitalisé en réa à 24 h **OUI/NON** --- # La réponse est  <BR> **Mais quelle est la question ?** --- # Quelles données ? ##Variables explicatives ### Celles qui peuvent influer sur la variable terminale - âge PAM SaO2 Fq resp |hellip; <BR> ### Variable terminale / expliquée / de tri|hellip; - Le résultat - Le plus souvent binaire - Vivant/mort Intubé à h48 oui/non --- # Liste de variables | |abrégé|type|valeurs ---|---|---|---|--- 1|Âge du patient|age|entier|18--110 ans 2|Sexe|sexe|facteur|F / M 3|BMI |bmi|entier| 10{80{Kg\per\meter\squared 4|IGS II à l’admission|igsadm|entier|\SIrange{6{150{\, 5|Oxygénothérapie|oxy|entier|\SIrange{0{20{\liter\per\min 6|Ventilation invasive|vi|facteur|oui/non 7|Ventilation non invasive|vni|facteur|oui/non 8|Sédation|sedation|facteur|oui/non 9|Curarisation|curarisation|facteur|oui/non/nsp |hellip;|||| --- # Variables|hellip;En pratique \begin{columns \begin{column{0.48\linewidth ![width=\linewidth]{images/ecran \end{column \begin{column{0.5\linewidth \begin{block{Questionnaire -- html \begin{verbatim <p> Âge du patient <input type = 'NUMBER' name = 'age' min = '18' max = '110'> </p> \end{verbatim \end{block <BR> \begin{block{Test de Student -- R \begin{verbatim t.test(age~sexe) \end{verbatim \end{block \end{column \end{columns --- # Des variables \structure{On recueille : ---# Nombre de patients \structure {Le calcul doit être fait a priori (*Calcul de puissance*) <BR> \begin{block{Nb de sujets \Huge{\textbf{Strict minimum : 30 par groupe. \end{block <BR> \Large{\emph{Le calcul n'a de sens que s'il y a un test principal avec une hypothèse claire --- # Nombre de patients \Large \[ n_a = \frac{1{2 \frac{z_{\alpha/2-z_{1-\beta{\arcsin(\sqrt{p_{ref)-\arcsin(\sqrt{\color{red{p_{nouveau) \] #Décrire sa population --- # Le problème \footnotesize 164 180 187 180 180 170 {\color{red{NA 170 165 168 170 160 172 {\color{red{NA 169 160 {\color{red{NA 175 170 {\color{red{NA 155 172 150 {\color{red{NA 170 {\color{red{NA 175 180 {\color{red{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 {\color{red{NA {\color{red{NA 160 160 155 174 182 182 170 180 163 {\color{red{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 {\color{red{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 {\color{red{NA 177 180 168 165 152 170 180 {\color{red{NA 171 176 160 177 170 150 165 160 175 172 {\color{red{NA 150 {\color{red{NA 170 {\color{red{NA 165 150 167 167 170 165 160 {\color{red{NA 175 165 160 170 166 165 185 165 175 182 170 175 162 {\color{red{NA 167 162 163 177 160 165 167 165 165 ] 180 172 {\color{red{NA 170 147 173 174 {\color{red{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 --- # Un petit dessin \begin{block{ ![width=\linewidth]{images/taille0 \end{block --- # Résumer l'information \begin{columns \column[t]{.48\textwidth \begin{block{1 ou 2 chiffres ![width=.8\linewidth]{images/chiffres \begin{itemize - Moyenne - \ - |hellip; \end{itemize \end{block \column[t]{.48\textwidth \begin{block{1 ou 2 dessins \begin{center ![height=.7\textheight]{images/dessin \end{center \end{block \end{columns --- # Décrire ![width=\linewidth]{images/igs1 --- # Le "\emph{milieu" \large \begin{description \item [Mode] le plus \item [Médiane] au milieu \item [Moyenne(s)] Valeur unique que devraient avoir tous les individus d'une population pour que leur total soit inchangé \item[|hellip;] ~ \end{description --- # Le "\emph{milieu" \centering !<1>[width=0.9\linewidth]{images/igs1 !<2>[width=0.9\linewidth]{images/igs2 !<3>[width=\linewidth]{images/igs3 !<4>[height=0.8\textheight]{images/survie1 !<5>[height=0.8\textheight]{images/survie2 --- # la "\emph{largeur" ![height=0.9\textheight]{images/igs4 --- # la "\emph{largeur" \Large \begin{exampleblock{Écart-type~/~Variance Distance de chaque individu à la moyenne \end{exampleblock <BR> \begin{exampleblock{Quantiles Fourchette où se trouvent plus de x\,\ des individus \end{exampleblock --- # la "\emph{largeur" \begin{center !<1>[height=0.95\textheight]{images/sd1 !<2>[height=0.95\textheight]{images/sd2 !<3>[height=0.9\textheight]{images/boxplot ![height=0.95\textheight]<4>{images/ic !<4>[width=.95\linewidth]{images/filles \end{center --- # Il n'y a pas que des chiffres|hellip; \footnotesize F M F M M F M M M F F F M M M F F M M M M M M M M M M M M F M F M M M M M F M F M M F F F F M F F M F M F M M M M F M F F M F F F M M M M M F M M F M F M F F M M M M M M M M M M F M M M F M M M F M F F F F F M F M F M M F M M F M M M M M M M M M M F F M M M M M M M F M M M F F M M F F F M M F M M F M F M M M M M F F M M F F M F F M M M M M M M M F M F M M F F F M F F F M F M F M M F M M F F M M M M M F M M M M F F F F F F M F F M F F M M M M F M F F F F M F M M M M M F M M M {\color{red{NA M F M F M M F M M F M F M F M F M M F M M M F M F F F M F M M M M M F F M M M F M M M M F M F F M F M M F M M M F M F F M M M F F F M M F F F M M M M M F M F M F F M M F F F M F F M F F F F F F M F F M M F M F M M M M F M F F F M M F F M F M F M F F F M F F F F M M M F M F F F F F F F F M M M F M M M M F F M M --- # Il n'y a pas que des chiffres|hellip; \Large \structure{Pourcentage~ \pause \textbf{toujours avec son intervalle de confiance <BR> \begin{alertblock{\ hommes [I. conf 95\,\ ] \begin{center ~ \huge \textbf{65,9~ [\,59,3 ~;~ 72,1\,] ~ \end{center \end{alertblock --- # \ ± intervalle de confiance !<1>[width=\linewidth]{images/ic1 !<2>[width=\linewidth]{images/ic2 --- # On creuse la mine|hellip; \begin{center !<1>[width=.8\linewidth]{images/data5 !<2>[width=.9\linewidth]{images/class1 !<3>[width=.7\linewidth]{images/mots1 \end{center #Liaison --- # Deux variables \begin{block{Poids \| Taille \begin{itemize - Une liaison entre les deux ? \end{itemize \end{block \pause <BR> \begin{alertblock{Attention ! {\Large Prouver un lien ne prouve pas une causalité \end{alertblock --- # Deux variables liées ? \centering \large \begin{tikzpicture \tikzset{fleche/.style={very thick,<-> \node (bio)at (0,0) {Manger bio; \node (vieux)at (8,0) {Vivre vieux; \node [text width = 10em, text centered](autre) at (4,4) {~; \draw [fleche] (bio) -- (vieux); \end{tikzpicture --- # Deux variables liées ? \centering \large \begin{tikzpicture \tikzset{fleche/.style={very thick,-> \node (bio)at (0,0) {Manger bio; \node (vieux)at (8,0) {Vivre vieux; \node [text width = 10em, text centered](autre) at (4,4) {CSP+ Attention à la santé; \draw [fleche] (bio) -- (vieux); \draw [fleche] (bio) -> (autre); \draw [fleche] (autre) -> (vieux); \end{tikzpicture --- # Causalité|hellip; ![width=\linewidth]{images/miss --- # Deux variables !<1>[width=\linewidth]{images/corr2 !<2>[width=\linewidth]{images/corr1 #Comparaison 0 --- # Deux groupes \Large La taille diffère selon le sexe ? --- # Deux groupes ![width=\linewidth]{images/taille_sexe --- # Comparaison \Large \begin{alertblock{~IMPOSSIBLE \begin{itemize - On ne peut jamais affirmer ou infirmer une différence entre des groupes \end{itemize \end{alertblock <BR> \begin{exampleblock{Parfois possible \begin{itemize \item On ne peut que calculer le risque d'erreur quand on affirme la différence \end{itemize \end{exampleblock --- # petit p \Large \begin{block{Expression de l'erreur \begin{description - [p < 0,05]En affirmant une différence entre les groupes on a moins de \pc{5 de chance de se tromper \end{description \end{block --- # Des tests|hellip; \begin{columns \begin{column{.59\linewidth \begin{itemize - t de Student - `\(\chi^2\)` - test non paramétrique de Wilcoxon - \textsc{ANOVA - Analyse de Cox - Coefficient de corrélation (Spearman ou Pearson) - test de Cochran-Mantel-Haenszel - |hellip; \end{itemize \end{column \begin{column{.39\linewidth \begin{block{plein de math|hellip; \small \begin{align* s^2 |=\sum_{x=1^n \frac{(x_n-\bar{x)^2{n-1 f(x)|= \frac{1{\sqrt{2 \pi \sigma^{2e^{\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 |= { [ {\sum_{i=1^K (A_i - {N_{1i M_{1i\over T_i) ]^2 \over {\sum_{i=1^K {N_{1iN_{2iM_{1iM_{2i \over T_i^2(T_i-1) \end{align* \end{block \end{column \end{columns --- # Quel test ? \begin{columns[t] \begin{column{.48\linewidth \begin{block{Numérique \structure{Selon|hellip; \begin{itemize - Le nombre de cas - La forme de la répartition - Le nombre de groupes - |hellip; \end{itemize \end{block \begin{block{ \begin{itemize - t de Student - Mann \| Whitney - \textsc{Anova - |hellip; \end{itemize \end{block \end{column \begin{column{.48\linewidth \begin{alertblock{~\ \begin{itemize - Oui/non - H/F - Un peu /beaucoup/|hellip; \end{itemize \end{alertblock \begin{alertblock{ \begin{itemize - `\(\chi^2\)` - Fisher - |hellip; \end{itemize \end{alertblock \end{column \end{columns --- # Analyse simple \begin{block{ ![width=\linewidth]{images/anasimple \end{block --- # Deux variables liées ? \centering \large \begin{tikzpicture \tikzset{fleche/.style={very thick,-> \node (bio)at (0,0) {Manger bio; \node (vieux)at (8,0) {Vivre vieux; \node [text width = 10em, text centered](autre) at (4,4) {; \draw [fleche] (bio) -- (vieux); \draw [fleche] (bio) -> (autre); \draw [fleche] (autre) -> (vieux); \end{tikzpicture --- # Deux variables liées ? \centering \large \begin{tikzpicture \tikzset{fleche/.style={very thick,-> \node (bio)at (0,0) {Manger bio; \node (vieux)at (8,0) {Vivre vieux; \node [text width = 10em, text centered](autre) at (4,4) {; \draw [fleche] (bio) -- (vieux); \draw [fleche] (bio) -> (autre); \draw [fleche] (autre) -> (vieux); \end{tikzpicture --- # Deux variables liées ? \centering \large \begin{tikzpicture \tikzset{fleche/.style={very thick,-> \node (bio)at (0,0) {Manger bio; \node (vieux)at (8,0) {Vivre vieux; \node [text width = 10em, text centered](autre) at (4,4) {CSP+ Attention à la santé; \draw [fleche] (bio) -- (vieux); \draw [fleche] (bio) -> (autre); \draw [fleche] (autre) -> (vieux); \end{tikzpicture --- ![width=\linewidth]{images/cor1 --- # Corrélation simple \framesubtitle{Poids \| Taille \large \begin{center \[ Poids = a * Taille + b + \varepsilon \] ![width=0.7\linewidth]{images/cor2 \end{center --- ![width=\linewidth]{images/cor3 --- # Un ensemble de données \begin{block{Régression (logistique, linéaire|hellip;) \[ \begin{array{rl \text{Poids|= f(x)|=a_1(\text{Taille)+a_2(\text{Sexe)+a_3(\text{Âge)+\cdots+b + \varepsilon \end{array \] \end{block <BR> \raggedleft{\structure{\large Analyse multivariée --- # Analyse multivariée \begin{block{ ![width=\linewidth]{images/multi \end{block --- # Autres analyses \centering !<1>[width=0.9\linewidth]{images/survie_tech !<2>[width=\linewidth]{images/minard --- # Un peu de recul|hellip; \begin{exampleblock{Sondage \begin{itemize - 1200 personnes interrogées - \pc{52 favorables à |hellip; \end{itemize <BR> \pause \end{exampleblock \begin{alertblock{Intervalle de confiance à 95\,\ \large \begin{center 52~ [49,12967 ; 54,86051] \end{center \end{alertblock --- # Un peu de recul|hellip; \begin{block{ \[ IC_{95\ \= p \pm z_{\alpha /2\sqrt{\frac{p(1-p){n-1 \] \end{block \pause <BR> ![width=\linewidth]{images/vingt --- # Diminuer l'erreur \begin{center ![width=.6\linewidth]{images/garbage \end{center \large \begin{itemize \item Avoir une population homogène \item Protocole, questionnaire|hellip; \item<2> \textbf{Grand nombre de cas \end{itemize --- # Nombre \large \begin{block{Interêt de la reperfusion précoce dans l'IdM \structure{GUSTO I \begin{itemize - \SI{40000{cas \end{itemize \end{block <BR> \begin{block{Aspirine dans l'IdM en phase aiguë \structure{ISIS--2 \begin{itemize - \SI{17187{cas \end{itemize \end{block --- # Conclusions \large \begin{itemize - Bien définir sa population \| ses variables - \textbf{Beaucoup de cas - Chasser les \textbf{données manquantes - Bien décrire sa population - Ensuite des tests (et des p<0,05) \end{itemize ---[plain] \begin{center \textbf{\Large Il existe trois types de menteurs : \textbf{\huge ~ \begin{enumerate - les menteurs - les fieffés menteurs - et les \alert{statisticiens \end{enumerate \end{center