library(tidyverse)
── Attaching packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
✔ ggplot2 3.1.1          ✔ purrr   0.3.2     
✔ tibble  2.1.3          ✔ dplyr   0.8.1     
✔ tidyr   0.8.3.9000     ✔ stringr 1.4.0     
✔ readr   1.3.1          ✔ forcats 0.3.0     
── Conflicts ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
df <- read_csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vStv7Pr69DtRKv6Nw6gVBep8hbT3pEeO6B1vNwxK_1DUHgpoTgbuRpZ4SvgtHFQnBZJVGeeQVyRuXZl/pub?gid=1348023451&single=true&output=csv")
Parsed with column specification:
cols(
  `N° de Ficha` = col_double(),
  Grupo = col_character(),
  Edad = col_double(),
  sexo = col_character(),
  `N_cepillados/dia` = col_double(),
  Indice_CariesCOPD = col_double(),
  EPB = col_double(),
  IG_Sesion1 = col_double(),
  IH_Sesion1 = col_double(),
  IG_Sesion2 = col_double(),
  IH_Sesion2 = col_double()
)
glimpse(df)
Observations: 54
Variables: 11
$ n_de_ficha         <dbl> 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 5…
$ grupo              <chr> "Malva", "CHX", "Control", "Control", "Control", "Malva", "Malva", "Malva", "Malva", "Control", "CHX", "Control", "Malva", "Malva", "CHX", "Control", "CHX", "Control", "Malva…
$ edad               <dbl> 50, 71, 22, 58, 48, 27, 23, 18, 19, 25, 48, 25, 62, 44, 46, 61, 51, 29, 29, 18, 28, 56, 25, 23, 38, 23, 18, 44, 25, 23, 19, 50, 22, 27, 22, 21, 22, 22, 21, NA, 24, 23, 23, 23…
$ sexo               <chr> "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "hombre", "mujer", "mujer", "mujer", "mujer", "mujer", "hombre", "hombre", "mujer", "mujer", …
$ n_cepillados_dia   <dbl> 3, 2, 3, 2, 3, 3, 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2, 2, 3, 3, 2, 3, 3, 2, 5, 3, 3, 3, 4, 1, 3, 2, 3, 2, 3, 3, 2, 2, 4, 3, 2, 3, 3, 3, 3, 2, 3, 2
$ indice_caries_copd <dbl> 10, 26, 0, 12, 7, 3, 0, 8, 5, 4, 0, 8, 23, 15, 20, 11, 20, 12, 7, 0, 7, 0, 6, 3, 16, 1, 6, 16, 5, 4, 8, 17, 9, 5, 0, 5, 0, 0, 5, 5, 1, 2, 8, 2, 10, 2, 0, 0, 0, 4, 10, 5, 4, 0
$ epb                <fct> 3, 3, 2, 4, 3, 2, 3, 2, 3, 2, 3, 3, 3, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 2, 3, 4, 3, 3, 4, 3, 3, 3, 3, 3, 4, 4, 3, 4
$ ig_sesion1         <dbl> 1.68, 1.48, 1.32, 1.58, 0.94, 1.34, 1.21, 1.48, 1.39, 1.55, 1.27, 1.30, 1.65, 1.84, 1.14, 1.50, 1.36, 1.24, 1.52, 1.57, 1.49, 1.15, 1.20, 0.76, 1.14, 1.52, 0.85, 1.48, 1.40, …
$ ih_sesion1         <dbl> 83.92, 68.05, 64.58, 76.04, 71.42, 63.88, 52.67, 69.64, 53.12, 76.85, 80.55, 70.53, 85.00, 72.32, 54.34, 72.00, 89.81, 85.18, 55.17, 95.00, 77.67, 85.71, 58.92, 53.57, 66.66,…
$ ig_sesion2         <dbl> 1.22, 1.45, 1.33, 1.16, 0.61, 1.44, 1.19, 1.31, 1.03, 1.10, 1.05, 1.23, 1.36, 1.90, 1.30, 1.57, 1.27, 0.87, 1.43, 1.65, 1.40, 0.87, 0.98, 0.81, 1.00, 1.24, 0.83, 1.28, 1.33, …
$ ih_sesion2         <dbl> 82.14, 62.50, 56.25, 75.00, 67.85, 53.70, 48.21, 56.25, 46.87, 93.51, 64.99, 47.32, 88.33, 78.57, 70.65, 67.00, 87.96, 71.29, 52.58, 70.00, 73.21, 81.25, 60.71, 47.32, 63.54,…
df <- df %>% 
  janitor::clean_names(df)
Error in match.arg(case) : 'arg' must be NULL or a character vector
skimr::skim(df)
Skim summary statistics
 n obs: 54 
 n variables: 11 

── Variable type:character ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 variable missing complete  n min max empty n_unique
    grupo       0       54 54   3   7     0        3
     sexo       0       54 54   5   6     0        2

── Variable type:factor ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 variable missing complete  n n_unique                top_counts ordered
      epb       0       54 54        3 3: 31, 2: 15, 4: 8, NA: 0   FALSE

── Variable type:numeric ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
           variable missing complete  n  mean    sd    p0   p25   p50   p75   p100     hist
               edad       1       53 54 32.06 14.05 18    23    25    44     71    ▇▆▁▂▂▁▁▁
         ig_sesion1       0       54 54  1.37  0.24  0.76  1.22  1.38  1.53   1.84 ▁▂▂▅▅▇▃▂
         ig_sesion2       0       54 54  1.23  0.25  0.61  1.03  1.25  1.39   1.9  ▁▃▆▇▇▃▂▁
         ih_sesion1       0       54 54 79.52 13.34 52.67 70.75 80.9  89.75 100    ▅▂▅▇▇▇▆▇
         ih_sesion2       0       54 54 75.13 15.06 46.87 63.9  75.52 87.06 100    ▅▂▅▇▆▇▅▇
 indice_caries_copd       0       54 54  6.61  6.45  0     1.25  5     9.75  26    ▇▆▃▂▁▁▁▁
   n_cepillados_dia       0       54 54  2.7   0.74  1     2     3     3      5    ▁▆▁▇▁▂▁▁
         n_de_ficha       0       54 54 31.67 17.44  2    16.25 32.5  46.75  60    ▇▇▅▇▇▆▇▇
table(df$grupo)

    CHX Control   Malva 
     18      18      18 
table(df$grupo, df$sexo)
         
          hombre mujer
  CHX         11     7
  Control      8    10
  Malva        2    16

Como estaban al inicio? Tabla 1

table1(~ factor(grupo) + edad + factor(sexo) + indice_caries_copd + epb, data=df)
Error in table1(~factor(grupo) + edad + factor(sexo) + indice_caries_copd +  : 
  no se pudo encontrar la función "table1"

efecto del colutorio sobre el IG

Comparaciones

Primer enfoque: en las diferencias

summary(glm(delta_ig ~ grupo + epb + indice_caries_copd  , data = df))

Call:
glm(formula = delta_ig ~ grupo + epb + indice_caries_copd, data = df)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.28288  -0.13520   0.00221   0.12263   0.49366  

Coefficients:
                     Estimate Std. Error t value Pr(>|t|)  
(Intercept)        -0.0463650  0.0663039  -0.699   0.4878  
grupoControl       -0.1421315  0.0616054  -2.307   0.0254 *
grupoMalva         -0.1489160  0.0612737  -2.430   0.0189 *
epb3               -0.0057179  0.0579291  -0.099   0.9218  
epb4                0.0001955  0.0818626   0.002   0.9981  
indice_caries_copd  0.0002752  0.0039800   0.069   0.9452  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 0.03355175)

    Null deviance: 1.8657  on 53  degrees of freedom
Residual deviance: 1.6105  on 48  degrees of freedom
AIC: -22.427

Number of Fisher Scoring iterations: 2
summary(glm(delta_ih ~ grupo + epb + indice_caries_copd  , data = df))

Call:
glm(formula = delta_ih ~ grupo + epb + indice_caries_copd, data = df)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-20.6531   -3.7250    0.0661    4.3376   20.8515  

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)   
(Intercept)         -9.0557     3.0324  -2.986  0.00444 **
grupoControl         3.8231     2.8175   1.357  0.18115   
grupoMalva           1.4310     2.8023   0.511  0.61193   
epb3                 0.5937     2.6494   0.224  0.82365   
epb4                 5.7459     3.7440   1.535  0.13142   
indice_caries_copd   0.2603     0.1820   1.430  0.15926   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 70.17885)

    Null deviance: 3861.5  on 53  degrees of freedom
Residual deviance: 3368.6  on 48  degrees of freedom
AIC: 390.44

Number of Fisher Scoring iterations: 2

TAREA: comparar contra CONTROL

LS0tCnRpdGxlOiAiVEVzaXMgUGVkcm8gTWFsdmEgMjAxOSIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQpgYGB7cn0KbGlicmFyeSh0aWR5dmVyc2UpCmBgYAoKYGBge3J9CmRmIDwtIHJlYWRfY3N2KCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9zcHJlYWRzaGVldHMvZC9lLzJQQUNYLTF2U3R2N1ByNjlEdFJLdjZOdzZnVkJlcDhoYlQzcEVlTzZCMXZOd3hLXzFEVUhncG9UZ2J1UnBaNFN2Z3RIRlFuQlpKVkdlZVFWeVJ1WFpsL3B1Yj9naWQ9MTM0ODAyMzQ1MSZzaW5nbGU9dHJ1ZSZvdXRwdXQ9Y3N2IikKYGBgCmBgYHtyfQpoZWFkKGRmKQpgYGAKYGBge3J9CmdsaW1wc2UoZGYpCmBgYAoKYGBge3J9CmRmJEVQQiA8LSBhcy5mYWN0b3IoZGYkRVBCKQpgYGAKCmBgYHtyfQpkZiA8LSBqYW5pdG9yOjpjbGVhbl9uYW1lcyhkZikKYGBgCgpgYGB7cn0Kc2tpbXI6OnNraW0oZGYpCmBgYApgYGB7cn0KdGFibGUoZGYkZ3J1cG8pCmBgYAoKYGBge3J9CnRhYmxlKGRmJGdydXBvLCBkZiRzZXhvKQoKYGBgCgoKIyBDb21vIGVzdGFiYW4gYWwgaW5pY2lvPyBUYWJsYSAxCgpgYGB7cn0KCnRhY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