library(tidyverse)
[30m── [1mAttaching packages[22m ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──[39m
[30m[32m✔[30m [34mggplot2[30m 3.1.1 [32m✔[30m [34mpurrr [30m 0.3.2
[32m✔[30m [34mtibble [30m 2.1.3 [32m✔[30m [34mdplyr [30m 0.8.1
[32m✔[30m [34mtidyr [30m 0.8.3.[31m9000[30m [32m✔[30m [34mstringr[30m 1.4.0
[32m✔[30m [34mreadr [30m 1.3.1 [32m✔[30m [34mforcats[30m 0.3.0 [39m
[30m── [1mConflicts[22m ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
[31m✖[30m [34mdplyr[30m::[32mfilter()[30m masks [34mstats[30m::filter()
[31m✖[30m [34mdplyr[30m::[32mlag()[30m masks [34mstats[30m::lag()[39m
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` = [32mcol_double()[39m,
Grupo = [31mcol_character()[39m,
Edad = [32mcol_double()[39m,
sexo = [31mcol_character()[39m,
`N_cepillados/dia` = [32mcol_double()[39m,
Indice_CariesCOPD = [32mcol_double()[39m,
EPB = [32mcol_double()[39m,
IG_Sesion1 = [32mcol_double()[39m,
IH_Sesion1 = [32mcol_double()[39m,
IG_Sesion2 = [32mcol_double()[39m,
IH_Sesion2 = [32mcol_double()[39m
)
glimpse(df)
Observations: 54
Variables: 11
$ n_de_ficha [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<chr>[39m[23m "Malva", "CHX", "Control", "Control", "Control", "Malva", "Malva", "Malva", "Malva", "Control", "CHX", "Control", "Malva", "Malva", "CHX", "Control", "CHX", "Control", "Malva…
$ edad [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<chr>[39m[23m "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "mujer", "hombre", "mujer", "mujer", "mujer", "mujer", "mujer", "hombre", "hombre", "mujer", "mujer", …
$ n_cepillados_dia [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<fct>[39m[23m 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 [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<dbl>[39m[23m 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 [3m[38;5;246m<dbl>[39m[23m 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
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"
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