library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(haven)
library(lme4)
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
##
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
library(stargazer)
##
## Please cite as:
##
## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
##
## The following object is masked from 'package:dplyr':
##
## recode
##
## The following object is masked from 'package:purrr':
##
## some
library(MASS)
##
## Attaching package: 'MASS'
##
## The following object is masked from 'package:dplyr':
##
## select
library(ggstatsplot)
## You can cite this package as:
## Patil, I. (2021). Visualizations with statistical details: The 'ggstatsplot' approach.
## Journal of Open Source Software, 6(61), 3167, doi:10.21105/joss.03167
library(gtsummary)
##
## Attaching package: 'gtsummary'
##
## The following object is masked from 'package:MASS':
##
## select
df=read_sav("baseCompleta3.sav") %>%
filter(!Codigo %in% c("hado2/2018","hado19/2017") ) %>%
as_factor() %>%
mutate(hado=as.factor(hado), Sexo=as.factor(Sexo), EG=as.numeric(EG), Pesonacimiento=as.numeric(Pesonacimiento)) %>%
mutate(estudiomadre2=case_when(
estudiomadre %in% c("Primarios", "Formación profesional") ~ "Categoria1",
estudiomadre %in% c("Secundarios", "Universitarios") ~ "Categoria2",
TRUE ~ NA_character_),
estudiopadre2=case_when(
estudiopadre %in% c("Primarios", "Formación profesional") ~ "Categoria1",
estudiopadre %in% c("Secundarios", "Universitarios") ~ "Categoria2",
TRUE ~ NA_character_),
estudiofamilia=case_when(estudiopadre2=="Categoria2" | estudiomadre2=="Categoria2" ~ "Categoria2",
estudiopadre2=="Categoria1" | estudiomadre2=="Categoria1" ~ "Categoria1",
TRUE ~ NA_character_),
ocupacionmadre2=case_when(
ocupacionmadre %in% c("Trabajo fijo", "Trabajo temporal", "Autonoma") ~ "Trabaja",
ocupacionmadre %in% c("Estudiante", "en paro") ~ "No trabaja",
TRUE ~ NA_character_),
ocupacionpadre2=case_when(
ocupacionmadre %in% c("Trabajo fijo", "Trabajo temporal", "Autonoma") ~ "Trabaja",
ocupacionmadre %in% c("Estudiante", "en paro") ~ "No trabaja",
TRUE ~ NA_character_),
EG30omenos = ifelse(EG <= 30, "Si", "No"),
) %>%
dplyr::select(Codigo, hado, Sexo, EG, Pesonacimiento, everything()) #%>% slice(-c(101,69))
Lo primero es presentar las variables que se han recogido, eliminando las que no interesen finalmente:
vars=c("EG", "EG30omenos", "Pesonacimiento",
"DiasestanciaTOTAL", "tiempoLMexclusiva",
"cangurohospital", "LMexclusiva",
"edadmadre", "edadpadre", "estudiomadre", "estudiopadre", "estudiomadre2", "estudiopadre2", "estudiofamilia", "ocupacionmadre", "ocupacionpadre",
"ocupacionmadre2", "ocupacionpadre2",
"APGAR5", "apgarfamiliar",# ¿¿diasestancia neonatología??,
"lactmaternahospital","hijoanteriores", "hijosposteriores",
"informeenfermeralactancia", "informeenfermeraalta","informeenfermerapreparacionhogar",
"problemasaludalta", "tipoproblemasalud", "asiduourgencias", "motivourgencia", "ingresohospital", "asiduoCS", "asiduoprivada",
"COMUNICACION", "MOTORAGRUESA", "MOTORAFINA", "RESOLUCIONDEPROBLEMAS", "SOCIOINDIVIDUAL"
)
tabla_gt <- df %>%
select(all_of(c("hado", vars))) %>%
tbl_summary(by = hado, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_overall() %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## The following warnings were returned during `add_p()`:
## ! For variable `APGAR5` (`hado`) and "statistic", "p.value", and "parameter"
## statistics: Chi-squared approximation may be incorrect
## ! For variable `COMUNICACION` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `MOTORAFINA` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `RESOLUCIONDEPROBLEMAS` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `apgarfamiliar` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `estudiomadre` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `estudiopadre2` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `hijoanteriores` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `hijosposteriores` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `informeenfermeraalta` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `informeenfermeralactancia` (`hado`) and "statistic", "p.value",
## and "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `informeenfermerapreparacionhogar` (`hado`) and "statistic",
## "p.value", and "parameter" statistics: Chi-squared approximation may be
## incorrect
## ! For variable `motivourgencia` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `ocupacionmadre` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `ocupacionpadre` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `tipoproblemasalud` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | Overall N = 1461 |
CONTROL N = 961 |
HADO N = 501 |
p-value2 |
---|---|---|---|---|
EG | 33.0 (31.0, 34.0) | 32.0 (30.0, 34.0) | 33.5 (31.0, 34.0) | 0.10 |
EG30omenos | 0.3 | |||
No | 111 (76%) | 70 (73%) | 41 (82%) | |
Si | 35 (24%) | 26 (27%) | 9 (18%) | |
Pesonacimiento | 1,535 (1,160, 1,780) | 1,515 (1,180, 1,815) | 1,540 (1,140, 1,750) | 0.6 |
Total dias de ingreso | 25 (15, 39) | 26 (17, 44) | 21 (12, 37) | 0.064 |
Tiempo lactancia materna exclusiva (dias) | 30 (0, 150) | 26 (0, 105) | 60 (0, 210) | 0.019 |
Metodo canguro en Hospital | 0.7 | |||
Si | 124 (86%) | 80 (84%) | 44 (88%) | |
No | 21 (14%) | 15 (16%) | 6 (12%) | |
Unknown | 1 | 1 | 0 | |
Lactancia materna exclusiva | 0.12 | |||
Si | 94 (64%) | 57 (59%) | 37 (74%) | |
No | 52 (36%) | 39 (41%) | 13 (26%) | |
Edad madre | 34.0 (30.0, 37.0) | 34.0 (29.0, 36.5) | 34.0 (31.0, 38.0) | 0.2 |
Edad padre | 36.0 (33.0, 41.0) | 36.0 (32.0, 40.0) | 37.0 (33.0, 42.0) | 0.3 |
Unknown | 3 | 1 | 2 | |
Estudios madre | 0.4 | |||
Primarios | 12 (8.3%) | 9 (9.5%) | 3 (6.0%) | |
Secundarios | 33 (23%) | 22 (23%) | 11 (22%) | |
Formación profesional | 46 (32%) | 33 (35%) | 13 (26%) | |
Universitarios | 54 (37%) | 31 (33%) | 23 (46%) | |
Unknown | 1 | 1 | 0 | |
Estudios padre | 0.6 | |||
Primarios | 15 (10%) | 12 (13%) | 3 (6.3%) | |
Secundarios | 41 (29%) | 26 (27%) | 15 (31%) | |
Formacion Profesional | 42 (29%) | 26 (27%) | 16 (33%) | |
Universitarios | 45 (31%) | 31 (33%) | 14 (29%) | |
Unknown | 3 | 1 | 2 | |
estudiomadre2 | 0.2 | |||
Categoria1 | 58 (40%) | 42 (44%) | 16 (32%) | |
Categoria2 | 87 (60%) | 53 (56%) | 34 (68%) | |
Unknown | 1 | 1 | 0 | |
estudiopadre2 | 0.5 | |||
Categoria1 | 15 (15%) | 12 (17%) | 3 (9.4%) | |
Categoria2 | 86 (85%) | 57 (83%) | 29 (91%) | |
Unknown | 45 | 27 | 18 | |
estudiofamilia | 0.8 | |||
Categoria1 | 32 (22%) | 22 (23%) | 10 (20%) | |
Categoria2 | 114 (78%) | 74 (77%) | 40 (80%) | |
Ocupacion madre | 0.7 | |||
Estudiante | 45 (32%) | 28 (30%) | 17 (36%) | |
Trabajo fijo | 60 (43%) | 39 (41%) | 21 (45%) | |
Trabajo temporal | 10 (7.1%) | 7 (7.4%) | 3 (6.4%) | |
en paro | 24 (17%) | 18 (19%) | 6 (13%) | |
Autonoma | 2 (1.4%) | 2 (2.1%) | 0 (0%) | |
Unknown | 5 | 2 | 3 | |
Ocupacion padre | 0.093 | |||
estudiante | 22 (16%) | 12 (13%) | 10 (21%) | |
Trabajo fijo | 82 (58%) | 54 (57%) | 28 (60%) | |
Trabajo temporal | 19 (13%) | 17 (18%) | 2 (4.3%) | |
En paro | 17 (12%) | 11 (12%) | 6 (13%) | |
Autonomo | 1 (0.7%) | 0 (0%) | 1 (2.1%) | |
Unknown | 5 | 2 | 3 | |
ocupacionmadre2 | >0.9 | |||
No trabaja | 69 (49%) | 46 (49%) | 23 (49%) | |
Trabaja | 72 (51%) | 48 (51%) | 24 (51%) | |
Unknown | 5 | 2 | 3 | |
ocupacionpadre2 | >0.9 | |||
No trabaja | 69 (49%) | 46 (49%) | 23 (49%) | |
Trabaja | 72 (51%) | 48 (51%) | 24 (51%) | |
Unknown | 5 | 2 | 3 | |
Puntuacion APGAR a los 5 minutos | >0.9 | |||
1 | 1 (0.7%) | 1 (1.0%) | 0 (0%) | |
3 | 1 (0.7%) | 1 (1.0%) | 0 (0%) | |
5 | 2 (1.4%) | 2 (2.1%) | 0 (0%) | |
6 | 2 (1.4%) | 1 (1.0%) | 1 (2.0%) | |
7 | 9 (6.2%) | 6 (6.3%) | 3 (6.1%) | |
8 | 21 (14%) | 14 (15%) | 7 (14%) | |
9 | 44 (30%) | 30 (31%) | 14 (29%) | |
10 | 65 (45%) | 41 (43%) | 24 (49%) | |
Unknown | 1 | 0 | 1 | |
Puntuacion global APGAR Familiar | 0.004 | |||
Disfunción severa | 9 (6.2%) | 8 (8.3%) | 1 (2.0%) | |
Disfunción moderada | 4 (2.7%) | 4 (4.2%) | 0 (0%) | |
Disfunción leve | 24 (16%) | 9 (9.4%) | 15 (30%) | |
Buena función | 109 (75%) | 75 (78%) | 34 (68%) | |
Dio lactancia materna Hospital | 0.7 | |||
Si | 113 (77%) | 73 (76%) | 40 (80%) | |
No | 33 (23%) | 23 (24%) | 10 (20%) | |
numero hijos anteriores | 0.2 | |||
0 | 68 (53%) | 46 (55%) | 22 (49%) | |
1 | 36 (28%) | 24 (29%) | 12 (27%) | |
2 | 20 (16%) | 10 (12%) | 10 (22%) | |
3 | 4 (3.1%) | 4 (4.8%) | 0 (0%) | |
4 | 1 (0.8%) | 0 (0%) | 1 (2.2%) | |
Unknown | 17 | 12 | 5 | |
Numero hijos posteriores | 0.021 | |||
0 | 100 (83%) | 67 (85%) | 33 (79%) | |
1 | 9 (7.4%) | 8 (10%) | 1 (2.4%) | |
2 | 12 (9.9%) | 4 (5.1%) | 8 (19%) | |
Unknown | 25 | 17 | 8 | |
Informacion lactancia enfermera | 0.3 | |||
Muy mala | 4 (3.7%) | 4 (6.5%) | 0 (0%) | |
Mala | 5 (4.6%) | 3 (4.8%) | 2 (4.3%) | |
Regular | 16 (15%) | 7 (11%) | 9 (20%) | |
Buena | 14 (13%) | 7 (11%) | 7 (15%) | |
Muy buena | 69 (64%) | 41 (66%) | 28 (61%) | |
Unknown | 38 | 34 | 4 | |
Informacion enfermera al alta | 0.055 | |||
Muy mala | 5 (4.5%) | 5 (8.1%) | 0 (0%) | |
Mala | 2 (1.8%) | 2 (3.2%) | 0 (0%) | |
Regular | 7 (6.3%) | 6 (9.7%) | 1 (2.0%) | |
Buena | 23 (21%) | 11 (18%) | 12 (24%) | |
Muy buena | 74 (67%) | 38 (61%) | 36 (73%) | |
Unknown | 35 | 34 | 1 | |
Enfermera HADO preparación Hogar | 0.006 | |||
Muy mala | 14 (13%) | 12 (20%) | 2 (4.1%) | |
Mala | 5 (4.5%) | 5 (8.2%) | 0 (0%) | |
Regular | 14 (13%) | 10 (16%) | 4 (8.2%) | |
Buena | 11 (10%) | 5 (8.2%) | 6 (12%) | |
Muy buena | 66 (60%) | 29 (48%) | 37 (76%) | |
Unknown | 36 | 35 | 1 | |
Problemas de salud al alta | 0.4 | |||
Si | 79 (54%) | 55 (57%) | 24 (48%) | |
No | 67 (46%) | 41 (43%) | 26 (52%) | |
Problemas salud | 0.7 | |||
Respiratorio | 38 (47%) | 27 (48%) | 11 (44%) | |
Digestivo | 8 (9.9%) | 4 (7.1%) | 4 (16%) | |
Psicomotor | 7 (8.6%) | 5 (8.9%) | 2 (8.0%) | |
Neurologico | 2 (2.5%) | 0 (0%) | 2 (8.0%) | |
Hematologico | 4 (4.9%) | 3 (5.4%) | 1 (4.0%) | |
Cardiaco | 4 (4.9%) | 3 (5.4%) | 1 (4.0%) | |
Otros | 6 (7.4%) | 4 (7.1%) | 2 (8.0%) | |
Respiratorio, Digestivo | 6 (7.4%) | 5 (8.9%) | 1 (4.0%) | |
Respiratorio, neurologico | 2 (2.5%) | 1 (1.8%) | 1 (4.0%) | |
Respiratorio, Hematologico | 1 (1.2%) | 1 (1.8%) | 0 (0%) | |
Digestivo, Psicomotor | 1 (1.2%) | 1 (1.8%) | 0 (0%) | |
Psicomotor, neurologico | 1 (1.2%) | 1 (1.8%) | 0 (0%) | |
Neurologico, cardiaco | 1 (1.2%) | 1 (1.8%) | 0 (0%) | |
Unknown | 65 | 40 | 25 | |
Visitas continuas Urgencias | 0.7 | |||
Si | 45 (31%) | 31 (32%) | 14 (28%) | |
No | 101 (69%) | 65 (68%) | 36 (72%) | |
Motivos visita urgencias | 0.4 | |||
respiratorio | 30 (67%) | 21 (68%) | 9 (64%) | |
Digestivo | 7 (16%) | 3 (9.7%) | 4 (29%) | |
Neurologico | 1 (2.2%) | 1 (3.2%) | 0 (0%) | |
Otros | 4 (8.9%) | 3 (9.7%) | 1 (7.1%) | |
Hematologico | 3 (6.7%) | 3 (9.7%) | 0 (0%) | |
Respiratorio, digestivo | 0 (0%) | 0 (0%) | 0 (0%) | |
Unknown | 101 | 65 | 36 | |
Ingresos posteriores hospital | 0.2 | |||
Si | 38 (26%) | 29 (31%) | 9 (18%) | |
No | 106 (74%) | 66 (69%) | 40 (82%) | |
Unknown | 2 | 1 | 1 | |
Visitas continuas CS | >0.9 | |||
Si | 44 (31%) | 29 (31%) | 15 (30%) | |
No | 100 (69%) | 65 (69%) | 35 (70%) | |
Unknown | 2 | 2 | 0 | |
Visitas continuas C. Privada | 0.2 | |||
Si | 18 (13%) | 9 (9.7%) | 9 (18%) | |
No | 125 (87%) | 84 (90%) | 41 (82%) | |
Unknown | 3 | 3 | 0 | |
Desarrollo psicomotor. Comunicacion | 0.9 | |||
Debajo expectativas | 11 (7.5%) | 7 (7.3%) | 4 (8.0%) | |
En rango | 15 (10%) | 9 (9.4%) | 6 (12%) | |
Encima expectativas | 120 (82%) | 80 (83%) | 40 (80%) | |
Psicomotor. Motora gruesa | 0.4 | |||
Debajo expectativas | 19 (13%) | 10 (10%) | 9 (18%) | |
En rango | 19 (13%) | 13 (14%) | 6 (12%) | |
Encima expectativas | 108 (74%) | 73 (76%) | 35 (70%) | |
Psicomotor. Motora Fina | 0.4 | |||
Debajo expectativas | 11 (7.5%) | 9 (9.4%) | 2 (4.0%) | |
En rango | 14 (9.6%) | 8 (8.3%) | 6 (12%) | |
Encima expectativas | 121 (83%) | 79 (82%) | 42 (84%) | |
Psicomotor. resolucion de problemas | 0.8 | |||
Debajo expectativas | 14 (9.6%) | 10 (10%) | 4 (8.0%) | |
En rango | 10 (6.8%) | 6 (6.3%) | 4 (8.0%) | |
Encima expectativas | 122 (84%) | 80 (83%) | 42 (84%) | |
Psicomotor. Socioindividual | 0.3 | |||
Debajo expectativas | 127 (87%) | 86 (90%) | 41 (82%) | |
En rango | 19 (13%) | 10 (10%) | 9 (18%) | |
1 Median (Q1, Q3); n (%) | ||||
2 Wilcoxon rank sum test; Pearson’s Chi-squared test |
Veamos que efecto tiene hado en dias de estancia con un modelo lineal ajustando por características del niño como la edad gestacional y el peso al nacer
m1 <- lm(DiasestanciaTOTAL ~ hado + EG+Pesonacimiento, data=df)
stargazer(m1, type = "text",
title = "Resultados de Regresión",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## =================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## -------------------------------------------------
## hadoHADO -3.836 (-8.969, 1.297)
## EG -5.444*** (-6.813, -4.076)
## Pesonacimiento -0.015** (-0.024, -0.006)
## Constant 230.346*** (195.754, 264.938)
## -------------------------------------------------
## Observations 146
## R2 0.665
## Adjusted R2 0.658
## Residual Std. Error 14.416 (df = 142)
## F Statistic 93.977*** (df = 3; 142)
## =================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
par(mfrow = c(2, 2))
plot(m1)
No sale el efecto del hado significativo, pero sí cuando se añaden características de los padres. No se si tiene lógica hacerlo:
m2 <- lm(DiasestanciaTOTAL ~ hado + EG+Pesonacimiento+estudiomadre+estudiopadre, data=df)
stargazer(m2, type = "text",
title = "Resultados de Regresión",
# se=NULL,
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## ===============================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## ---------------------------------------------------------------
## hadoHADO -5.510* (-10.884, -0.137)
## EG -5.131*** (-6.582, -3.681)
## Pesonacimiento -0.016*** (-0.025, -0.007)
## estudiomadreSecundarios 5.572 (-5.085, 16.228)
## estudiomadreFormación profesional -1.211 (-11.940, 9.518)
## estudiomadreUniversitarios 3.102 (-7.681, 13.885)
## estudiopadreSecundarios 1.464 (-7.847, 10.774)
## estudiopadreFormacion Profesional 1.415 (-8.261, 11.092)
## estudiopadreUniversitarios -1.375 (-11.189, 8.440)
## Constant 218.874*** (180.052, 257.697)
## ---------------------------------------------------------------
## Observations 142
## R2 0.657
## Adjusted R2 0.634
## Residual Std. Error 14.480 (df = 132)
## F Statistic 28.104*** (df = 9; 132)
## ===============================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
par(mfrow = c(2, 2))
plot(m2)
m2 <- lm(DiasestanciaTOTAL ~ hado + EG+Pesonacimiento+estudiomadre2+estudiopadre2, data=df)
stargazer(m2, type = "text",
title = "Resultados de Regresión",
# se=NULL,
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## =====================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## -----------------------------------------------------
## hadoHADO -6.513 (-13.968, 0.942)
## EG -4.488*** (-6.440, -2.536)
## Pesonacimiento -0.019** (-0.032, -0.006)
## estudiomadre2Categoria2 6.113 (-0.887, 13.113)
## estudiopadre2Categoria2 -0.942 (-10.027, 8.143)
## Constant 203.025*** (153.985, 252.065)
## -----------------------------------------------------
## Observations 100
## R2 0.617
## Adjusted R2 0.596
## Residual Std. Error 16.345 (df = 94)
## F Statistic 30.232*** (df = 5; 94)
## =====================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
m2 <- lm(DiasestanciaTOTAL ~ hado + EG+Pesonacimiento+estudiofamilia, data=df)
stargazer(m2, type = "text",
title = "Resultados de Regresión",
# se=NULL,
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## ======================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## ------------------------------------------------------
## hadoHADO -4.010 (-9.152, 1.132)
## EG -5.355*** (-6.733, -3.976)
## Pesonacimiento -0.015*** (-0.024, -0.006)
## estudiofamiliaCategoria2 3.028 (-2.677, 8.733)
## Constant 225.585*** (189.858, 261.311)
## ------------------------------------------------------
## Observations 146
## R2 0.668
## Adjusted R2 0.658
## Residual Std. Error 14.412 (df = 141)
## F Statistic 70.794*** (df = 4; 141)
## ======================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
Dada la pequeña desviación de la normalidad, podríamos probar una regresión robusta:
datos<- df
modelo_robusto <- rlm(DiasestanciaTOTAL ~ hado + EG + Pesonacimiento + estudiomadre + estudiopadre, data = datos)
stargazer(modelo_robusto, type = "text",
title = "Resultados de Regresión Robusta",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión Robusta
## ===============================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## ---------------------------------------------------------------
## hadoHADO -3.364** (-5.887, -0.842)
## EG -4.783*** (-5.464, -4.102)
## Pesonacimiento -0.016*** (-0.020, -0.012)
## estudiomadreSecundarios 2.535 (-2.468, 7.538)
## estudiomadreFormación profesional 0.076 (-4.961, 5.114)
## estudiomadreUniversitarios 1.767 (-3.296, 6.829)
## estudiopadreSecundarios 0.245 (-4.127, 4.616)
## estudiopadreFormacion Profesional 0.998 (-3.545, 5.541)
## estudiopadreUniversitarios -0.710 (-5.318, 3.897)
## Constant 206.538*** (188.311, 224.765)
## ---------------------------------------------------------------
## Observations 142
## Residual Std. Error 5.704 (df = 132)
## ===============================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
par(mfrow=c(2,2))
plot(modelo_robusto$residuals, main="Residuos del modelo robusto", ylab="Residuos", xlab="Índice")
abline(h=0, col="red")
qqnorm(modelo_robusto$residuals); qqline(modelo_robusto$residuals, col="blue")
datos<- df
modelo_robusto <- rlm(DiasestanciaTOTAL ~ hado + EG + Pesonacimiento + estudiomadre2 + estudiopadre2, data = datos)
stargazer(modelo_robusto, type = "text",
title = "Resultados de Regresión Robusta",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión Robusta
## =====================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## -----------------------------------------------------
## hadoHADO -3.272* (-6.448, -0.096)
## EG -4.462*** (-5.294, -3.631)
## Pesonacimiento -0.019*** (-0.024, -0.013)
## estudiomadre2Categoria2 2.910 (-0.072, 5.892)
## estudiopadre2Categoria2 -0.811 (-4.681, 3.060)
## Constant 200.130*** (179.239, 221.020)
## -----------------------------------------------------
## Observations 100
## Residual Std. Error 5.569 (df = 94)
## =====================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
datos<- df
modelo_robusto <- rlm(DiasestanciaTOTAL ~ hado + EG + Pesonacimiento + estudiofamilia, data = datos)
stargazer(modelo_robusto, type = "text",
title = "Resultados de Regresión Robusta",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión Robusta
## ======================================================
## Dependent variable:
## -----------------------------
## DiasestanciaTOTAL
## ------------------------------------------------------
## hadoHADO -2.810* (-5.191, -0.428)
## EG -4.941*** (-5.579, -4.302)
## Pesonacimiento -0.016*** (-0.020, -0.012)
## estudiofamiliaCategoria2 0.958 (-1.684, 3.600)
## Constant 212.724*** (196.180, 229.269)
## ------------------------------------------------------
## Observations 146
## Residual Std. Error 5.312 (df = 141)
## ======================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
datos <- as.data.frame(df)
# Ajuste del modelo con data bien especificado
m2 <- lm(DiasestanciaTOTAL ~ hado + EG + Pesonacimiento + estudiomadre + estudiopadre, data = datos)
# Aplicar Box-Cox
boxcox(m2)
EL gráfico nos sugiere usr la raíz cúbica de los días de estancia como variable dependiente (dificil de presentar seguramente en un trabajo):
lambda <- 0.33
m2_boxcox <- lm(((DiasestanciaTOTAL^lambda - 1) / lambda) ~ hado + EG + Pesonacimiento + estudiomadre + estudiopadre, data = datos)
stargazer(m2_boxcox, type = "text",
title = "Resultados de Regresión",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## ========================================================================
## Dependent variable:
## --------------------------------------
## ((DiasestanciaTOTALlambda - 1)/lambda)
## ------------------------------------------------------------------------
## hadoHADO -0.601* (-1.051, -0.150)
## EG -0.447*** (-0.569, -0.326)
## Pesonacimiento -0.002*** (-0.003, -0.001)
## estudiomadreSecundarios -0.023 (-0.917, 0.872)
## estudiomadreFormación profesional -0.403 (-1.304, 0.497)
## estudiomadreUniversitarios -0.163 (-1.067, 0.742)
## estudiopadreSecundarios 0.267 (-0.514, 1.048)
## estudiopadreFormacion Profesional 0.215 (-0.597, 1.026)
## estudiopadreUniversitarios -0.095 (-0.919, 0.728)
## Constant 23.719*** (20.462, 26.977)
## ------------------------------------------------------------------------
## Observations 142
## R2 0.734
## Adjusted R2 0.716
## Residual Std. Error 1.215 (df = 132)
## F Statistic 40.514*** (df = 9; 132)
## ========================================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
par(mfrow = c(2, 2))
plot(m2_boxcox)
ggbetweenstats(
data = df,
x = estudiomadre,
y = DiasestanciaTOTAL,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiopadre,
y = DiasestanciaTOTAL,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiomadre2,
y = DiasestanciaTOTAL,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiopadre2,
y = DiasestanciaTOTAL,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiofamilia,
y = DiasestanciaTOTAL,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = hado,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = hado,
y = tiempoLMexclusiva,
type = "nonparametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
¿El tiempo de canguro puede afectar a lactancia materna exclusiva a igualdad de edad gestacional, peso?
Si no se tiene en cuenta hado:
m_canguro_lm <- lm(tiempoLMexclusiva ~ tiempocanguro + EG + Pesonacimiento , data = df)
stargazer(m_canguro_lm, type = "text",
title = "Resultados de Regresión",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## =================================================
## Dependent variable:
## -----------------------------
## tiempoLMexclusiva
## -------------------------------------------------
## tiempocanguro 0.135 (-1.814, 2.083)
## EG 0.972 (-16.888, 18.832)
## Pesonacimiento -0.045 (-0.151, 0.062)
## Constant 136.962 (-390.641, 664.565)
## -------------------------------------------------
## Observations 124
## R2 0.013
## Adjusted R2 -0.012
## Residual Std. Error 160.503 (df = 120)
## F Statistic 0.522 (df = 3; 120)
## =================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
Si se tiene en cuenta hado:
m_canguro_lm <- lm(tiempoLMexclusiva ~ tiempocanguro + EG + Pesonacimiento + hado, data = df)
stargazer(m_canguro_lm, type = "text",
title = "Resultados de Regresión",
ci = TRUE, # para incluir IC95%
single.row = TRUE, # todo en una fila por variable
star.cutoffs = c(0.05, 0.01, 0.001))
##
## Resultados de Regresión
## =================================================
## Dependent variable:
## -----------------------------
## tiempoLMexclusiva
## -------------------------------------------------
## tiempocanguro 0.063 (-1.851, 1.977)
## EG -4.949 (-23.179, 13.282)
## Pesonacimiento -0.011 (-0.119, 0.098)
## hadoHADO 72.764* (11.641, 133.887)
## Constant 253.505 (-273.760, 780.770)
## -------------------------------------------------
## Observations 124
## R2 0.056
## Adjusted R2 0.024
## Residual Std. Error 157.611 (df = 119)
## F Statistic 1.767 (df = 4; 119)
## =================================================
## Note: *p<0.05; **p<0.01; ***p<0.001
¿tiempo canguro se asocia con lactmaternahospital, estudiomadre, estudiopadre, ocupacionmadre, ocupacionpadre, hijoanteriores, informeenfermeralactancia?
ggbetweenstats(
data = df,
x = lactmaternahospital,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiomadre,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = estudiopadre,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = ocupacionmadre,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = ocupacionmadre2,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = ocupacionpadre,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = ocupacionpadre2,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
ggbetweenstats(
data = df,
x = hijoanteriores,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
## Warning: Groups with fewer than two datapoints have been dropped.
## ℹ Set `drop = FALSE` to consider such groups for position adjustment purposes.
ggbetweenstats(
data = df,
x = informeenfermeralactancia,
y = tiempocanguro,
type = "parametric", # usa ANOVA por defecto; cambia a "nonparametric" si los supuestos no se cumplen
pairwise.comparisons = TRUE,
pairwise.display = "significant", # solo muestra comparaciones significativas
mean.ci = TRUE, # añade IC a las medias
messages = FALSE # evita mensajes de consola
)
tiempocanguro en dias creemos que afecta a===> DiasestanciaTOTAL, tiempoLMexclusiva,
ggscatterstats(
data = df,
x = tiempocanguro,
y = DiasestanciaTOTAL,
type = "parametric" # Pearson (por defecto)
)
ggscatterstats(
data = df,
x = tiempocanguro,
y = tiempoLMexclusiva,
type = "nonparametric" # Pearson (por defecto)
)
problemasaludalta, tipoproblemasalud, asiduourgencias, motivourgencia, ingresohospital, asiduoCS, asiduoprivada
vars=c("problemasaludalta", "tipoproblemasalud", "asiduourgencias", "motivourgencia", "ingresohospital", "asiduoCS", "asiduoprivada")
tabla_gt <- df %>%
select(all_of(c("hado", vars))) %>%
tbl_summary(by = hado, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## The following warnings were returned during `add_p()`:
## ! For variable `motivourgencia` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `tipoproblemasalud` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | CONTROL N = 961 |
HADO N = 501 |
p-value2 |
---|---|---|---|
Problemas de salud al alta | 0.4 | ||
Si | 55 (57%) | 24 (48%) | |
No | 41 (43%) | 26 (52%) | |
Problemas salud | 0.7 | ||
Respiratorio | 27 (48%) | 11 (44%) | |
Digestivo | 4 (7.1%) | 4 (16%) | |
Psicomotor | 5 (8.9%) | 2 (8.0%) | |
Neurologico | 0 (0%) | 2 (8.0%) | |
Hematologico | 3 (5.4%) | 1 (4.0%) | |
Cardiaco | 3 (5.4%) | 1 (4.0%) | |
Otros | 4 (7.1%) | 2 (8.0%) | |
Respiratorio, Digestivo | 5 (8.9%) | 1 (4.0%) | |
Respiratorio, neurologico | 1 (1.8%) | 1 (4.0%) | |
Respiratorio, Hematologico | 1 (1.8%) | 0 (0%) | |
Digestivo, Psicomotor | 1 (1.8%) | 0 (0%) | |
Psicomotor, neurologico | 1 (1.8%) | 0 (0%) | |
Neurologico, cardiaco | 1 (1.8%) | 0 (0%) | |
Unknown | 40 | 25 | |
Visitas continuas Urgencias | 0.7 | ||
Si | 31 (32%) | 14 (28%) | |
No | 65 (68%) | 36 (72%) | |
Motivos visita urgencias | 0.4 | ||
respiratorio | 21 (68%) | 9 (64%) | |
Digestivo | 3 (9.7%) | 4 (29%) | |
Neurologico | 1 (3.2%) | 0 (0%) | |
Otros | 3 (9.7%) | 1 (7.1%) | |
Hematologico | 3 (9.7%) | 0 (0%) | |
Respiratorio, digestivo | 0 (0%) | 0 (0%) | |
Unknown | 65 | 36 | |
Ingresos posteriores hospital | 0.2 | ||
Si | 29 (31%) | 9 (18%) | |
No | 66 (69%) | 40 (82%) | |
Unknown | 1 | 1 | |
Visitas continuas CS | >0.9 | ||
Si | 29 (31%) | 15 (30%) | |
No | 65 (69%) | 35 (70%) | |
Unknown | 2 | 0 | |
Visitas continuas C. Privada | 0.2 | ||
Si | 9 (9.7%) | 9 (18%) | |
No | 84 (90%) | 41 (82%) | |
Unknown | 3 | 0 | |
1 n (%) | |||
2 Pearson’s Chi-squared test |
En la tabla anterior hay variables vistas con menos y más detalle. Por ejemplo, “problemasaludalta” es una variable que tiene dos categorías: “Sí” y “No”. Pero también hay una variable “tipoproblemasalud” que tiene más detalle sobre los problemas de salud. La que da mucho detalle no se necesita cuando realmente no tenemos mucha muestra.
COMUNICACIÓN, MOTORA GRUESA, MOTORAFINA, RESOLUCIÓNDEPROBLEMAS, SOCIOINDIVIDUAL ⇐ HADo
vars=c("COMUNICACION", "MOTORAGRUESA", "MOTORAFINA", "RESOLUCIONDEPROBLEMAS", "SOCIOINDIVIDUAL" )
tabla_gt <- df %>%
select(all_of(c("hado", vars))) %>%
tbl_summary(by = hado, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## The following warnings were returned during `add_p()`:
## ! For variable `COMUNICACION` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `MOTORAFINA` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
## ! For variable `RESOLUCIONDEPROBLEMAS` (`hado`) and "statistic", "p.value", and
## "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | CONTROL N = 961 |
HADO N = 501 |
p-value2 |
---|---|---|---|
Desarrollo psicomotor. Comunicacion | 0.9 | ||
Debajo expectativas | 7 (7.3%) | 4 (8.0%) | |
En rango | 9 (9.4%) | 6 (12%) | |
Encima expectativas | 80 (83%) | 40 (80%) | |
Psicomotor. Motora gruesa | 0.4 | ||
Debajo expectativas | 10 (10%) | 9 (18%) | |
En rango | 13 (14%) | 6 (12%) | |
Encima expectativas | 73 (76%) | 35 (70%) | |
Psicomotor. Motora Fina | 0.4 | ||
Debajo expectativas | 9 (9.4%) | 2 (4.0%) | |
En rango | 8 (8.3%) | 6 (12%) | |
Encima expectativas | 79 (82%) | 42 (84%) | |
Psicomotor. resolucion de problemas | 0.8 | ||
Debajo expectativas | 10 (10%) | 4 (8.0%) | |
En rango | 6 (6.3%) | 4 (8.0%) | |
Encima expectativas | 80 (83%) | 42 (84%) | |
Psicomotor. Socioindividual | 0.3 | ||
Debajo expectativas | 86 (90%) | 41 (82%) | |
En rango | 10 (10%) | 9 (18%) | |
1 n (%) | |||
2 Pearson’s Chi-squared test |
EG, Pesonacimiento, APGAR5, ¿¿diasestancia neonatología??, cangurohospital, LMexclusiva edadmadre, edadpadre, estudiosmadre, estudiospadre, ocupacionmadre, ocupacionpadre
Siguiente versión:
ocupaciones: Trabajo, No trabaja Estudios: Primaria y FP vs Secundaria+
Problemas de salud variados ==> Sano: Si/No (Los missing se consideran sanos)
Podemos fabricar una variable estudiosfamilia. Una se basa en el nivel más alto de ambos
Tiene relación apgarfamiliar con estudiospadre y estudiosmadre y estudiosfamilia
El apgarfamiliar se asocia con los estudios de la madre
tabla_gt <- df %>%
select(all_of(c("apgarfamiliar","estudiomadre2"))) %>%
tbl_summary(by = estudiomadre2, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## 1 missing rows in the "estudiomadre2" column have been removed.
## The following warnings were returned during `add_p()`:
## ! For variable `apgarfamiliar` (`estudiomadre2`) and "statistic", "p.value",
## and "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | Categoria1 N = 581 |
Categoria2 N = 871 |
p-value2 |
---|---|---|---|
Puntuacion global APGAR Familiar | 0.010 | ||
Disfunción severa | 7 (12%) | 2 (2.3%) | |
Disfunción moderada | 0 (0%) | 4 (4.6%) | |
Disfunción leve | 5 (8.6%) | 18 (21%) | |
Buena función | 46 (79%) | 63 (72%) | |
1 n (%) | |||
2 Pearson’s Chi-squared test |
No con los del padre
tabla_gt <- df %>%
select(all_of(c("apgarfamiliar","estudiopadre2"))) %>%
tbl_summary(by = estudiopadre2, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## 45 missing rows in the "estudiopadre2" column have been removed.
## The following warnings were returned during `add_p()`:
## ! For variable `apgarfamiliar` (`estudiopadre2`) and "statistic", "p.value",
## and "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | Categoria1 N = 151 |
Categoria2 N = 861 |
p-value2 |
---|---|---|---|
Puntuacion global APGAR Familiar | >0.9 | ||
Disfunción severa | 1 (6.7%) | 8 (9.3%) | |
Disfunción moderada | 1 (6.7%) | 3 (3.5%) | |
Disfunción leve | 2 (13%) | 11 (13%) | |
Buena función | 11 (73%) | 64 (74%) | |
1 n (%) | |||
2 Pearson’s Chi-squared test |
Y no con el más alto en la familia
tabla_gt <- df %>%
select(all_of(c("apgarfamiliar","estudiofamilia"))) %>%
tbl_summary(by = estudiofamilia, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
## The following warnings were returned during `add_p()`:
## ! For variable `apgarfamiliar` (`estudiofamilia`) and "statistic", "p.value",
## and "parameter" statistics: Chi-squared approximation may be incorrect
# Mostrar
tabla_gt
Characteristic | Categoria1 N = 321 |
Categoria2 N = 1141 |
p-value2 |
---|---|---|---|
Puntuacion global APGAR Familiar | 0.5 | ||
Disfunción severa | 1 (3.1%) | 8 (7.0%) | |
Disfunción moderada | 0 (0%) | 4 (3.5%) | |
Disfunción leve | 4 (13%) | 20 (18%) | |
Buena función | 27 (84%) | 82 (72%) | |
1 n (%) | |||
2 Pearson’s Chi-squared test |
Veamos el de la asociación entre apgarfamiliar y los estudios de la madre con más detalle:
ggbarstats(
data = datos,
y = estudiomadre2,
x = apgarfamiliar,
results.subtitle = TRUE,
proportion.test = TRUE
)
¿informeenfermeraalta está relacionado con hado? Ver tabla inicial
¿Hay relación entre apgarfamiliar y EG?
No lo parece
tabla_gt <- df %>%
select(all_of(c("apgarfamiliar","EG"))) %>%
tbl_summary(by = apgarfamiliar, statistic = all_categorical() ~ "{n} ({p}%)") %>%
add_p(test = all_categorical() ~ "chisq.test") %>%
bold_labels()
# Mostrar
tabla_gt
Characteristic | Disfunción severa N = 91 |
Disfunción moderada N = 41 |
Disfunción leve N = 241 |
Buena función N = 1091 |
p-value2 |
---|---|---|---|---|---|
EG | 31.0 (30.0, 32.0) | 32.0 (30.5, 33.5) | 33.5 (31.0, 34.0) | 33.0 (31.0, 34.0) | 0.14 |
1 Median (Q1, Q3) | |||||
2 Kruskal-Wallis rank sum test |
¿Hay relación entre hijosposteriores y nivelestudios (todos)?