library(pacman)
p_load(tidyverse, # Manipulación y visualización de datos
openxlsx, # Importar archivos excel
patchwork, # Manipulación de gráficos
psych, # Estadisticos descriptivos
skimr, # Estadisticos descriptivos
car, # Análisis de homocedasticidad
corrr, # Análisis de correlación
effectsize) # Tamaño del efecto
data3_clean
y guárdala en un objetoburnout_df <- readxl::read_excel("data3_clean.xlsx")
demograficos <- burnout_df %>%
select(sexo:edad) %>%
filter(escuela == "Vocación salud",
sexo == "Mujer",
edad >= 18)
write.xlsx(demograficos, "demograficos.xlsx")
burnout_df <- burnout_df %>%
rowwise() %>%
mutate(bur_total = sum(c_across(bur1:bur24))) %>%
ungroup()
burnout_df <- burnout_df %>%
rowwise() %>%
mutate(ase_total = sum(c_across(ase1:ase31))) %>%
ungroup()
burnout_df <- burnout_df %>%
mutate(
bur_cat = case_when(bur_total <= 48 ~ "leve",
bur_total < 97 ~ "moderado",
bur_total >= 97 ~ "severo")
)
burnout_df <- burnout_df %>%
mutate(
ase_cat = case_when(ase_total < 62 ~ "baja",
ase_total <= 93 ~ "moderada",
ase_total >= 94 ~ "alta")
)
burnout_df %>%
filter(sexo == "Mujer",
convive == "Solo",
escuela == "Vocación salud") %>%
count(bur_cat) %>%
mutate(porcentaje = n/sum(n)*100)
burnout_df %>%
filter(sexo == "Mujer",
convive == "Solo",
escuela == "Vocación salud") %>%
count(ase_cat) %>%
mutate(porcentaje = n/sum(n)*100)
# Según la variable sexo
burnout_df %>%
select(bur_total, ase_total, sexo) %>%
describeBy(group = .$sexo)
##
## Descriptive statistics by group
## group: Hombre
## vars n mean sd median trimmed mad min max range skew kurtosis
## bur_total 1 15 91.27 26.11 95 92.08 31.13 48 124 76 -0.24 -1.47
## ase_total 2 15 73.20 13.93 68 72.08 10.38 57 104 47 0.75 -0.67
## sexo* 3 15 1.00 0.00 1 1.00 0.00 1 1 0 NaN NaN
## se
## bur_total 6.74
## ase_total 3.60
## sexo* 0.00
## ------------------------------------------------------------
## group: Mujer
## vars n mean sd median trimmed mad min max range skew kurtosis
## bur_total 1 54 81.65 36.51 94.0 84.43 37.06 10 125 115 -0.48 -1.24
## ase_total 2 54 74.91 16.09 67.5 74.18 11.12 44 114 70 0.50 -0.82
## sexo* 3 54 1.00 0.00 1.0 1.00 0.00 1 1 0 NaN NaN
## se
## bur_total 4.97
## ase_total 2.19
## sexo* 0.00
# Según la variable convive
burnout_df %>%
select(bur_total, ase_total, convive) %>%
describeBy(group = .$convive)
##
## Descriptive statistics by group
## group: Con familia
## vars n mean sd median trimmed mad min max range skew kurtosis
## bur_total 1 46 82.35 35.77 78 84.84 54.11 10 125 115 -0.45 -1.14
## ase_total 2 46 73.76 15.29 67 73.13 14.83 44 104 60 0.41 -0.98
## convive* 3 46 1.00 0.00 1 1.00 0.00 1 1 0 NaN NaN
## se
## bur_total 5.27
## ase_total 2.26
## convive* 0.00
## ------------------------------------------------------------
## group: Solo
## vars n mean sd median trimmed mad min max range skew kurtosis
## bur_total 1 23 86.52 32.62 100 89.16 20.76 14 124 110 -0.70 -0.96
## ase_total 2 23 76.09 16.32 68 74.63 10.38 53 114 61 0.75 -0.69
## convive* 3 23 1.00 0.00 1 1.00 0.00 1 1 0 NaN NaN
## se
## bur_total 6.8
## ase_total 3.4
## convive* 0.0
# Elaborar histograma de la variable burnout
p1 <- burnout_df %>%
ggplot(aes(x = bur_total)) +
geom_histogram(binwidth = 10,
color = "#121317",
fill = "#506AD4") +
labs(
title = "Distribución de puntajes de burnout",
subtitle = "Examen-Taller AMP",
x = "Burnout",
y = "Frecuencia"
) +
theme_bw()
# Elaborar histograma de la variable autoeficacia academica
p2 <- burnout_df %>%
ggplot(aes(x = ase_total)) +
geom_histogram(binwidth = 10,
color = "#121317",
fill = "#F2CC39") +
labs(
title = "Distribución de puntajes de autoeficacia académica",
subtitle = "Examen-Taller AMP",
x = "Autoeficacia académica",
y = "Frecuencia"
) +
theme_bw()
# Unir gráficos
p3 <- p1 + p2
# Exportar gráfico
ggsave(filename = "puntajes_variables.jpg",
plot = p3,
height = 4,
width = 8,
scale = 1.5,
dpi = 300)
p4 <- burnout_df %>%
count(bur_cat) %>%
mutate(porcentaje = n/sum(n)*100) %>%
ggplot(aes(x = porcentaje,
y = bur_cat,
fill = bur_cat)) +
geom_col() +
scale_fill_manual("Niveles",
values = c("severo" = "#D95F69",
"moderado" = "#F2E18D",
"leve" = "#BFB99B")) +
labs(title = "Categorías de la variable burnout",
subtitle = "Examen-Taller AMP",
x = NULL,
y = NULL) +
theme_minimal()
# Exportar gráfico
ggsave(filename = "barras_variables.jpg",
plot = p4,
height = 4,
width = 8,
scale = 1.5,
dpi = 300)
# Burnout y sexo
tapply(burnout_df$bur_total,
burnout_df$sexo,
shapiro.test)
## $Hombre
##
## Shapiro-Wilk normality test
##
## data: X[[i]]
## W = 0.92082, p-value = 0.1983
##
##
## $Mujer
##
## Shapiro-Wilk normality test
##
## data: X[[i]]
## W = 0.88445, p-value = 8.613e-05
# Autoeficacia académica y sexo
tapply(burnout_df$ase_total,
burnout_df$sexo,
shapiro.test)
## $Hombre
##
## Shapiro-Wilk normality test
##
## data: X[[i]]
## W = 0.90872, p-value = 0.1294
##
##
## $Mujer
##
## Shapiro-Wilk normality test
##
## data: X[[i]]
## W = 0.92655, p-value = 0.002668
Ambas variables no cumplen el supuesto de normalidad
# Burnout y sexo
leveneTest(burnout_df$bur_total ~ factor(burnout_df$sexo))
# Autoeficacia académica y sexo
leveneTest(burnout_df$ase_total ~ factor(burnout_df$sexo))
Ambas variables cumplen el supuesto de homocedasticidad
# Burnout y sexo
wilcox.test(burnout_df$bur_total ~ burnout_df$sexo)
##
## Wilcoxon rank sum test with continuity correction
##
## data: burnout_df$bur_total by burnout_df$sexo
## W = 462.5, p-value = 0.4068
## alternative hypothesis: true location shift is not equal to 0
# Autoeficacia académica y sexo
wilcox.test(burnout_df$ase_total ~ burnout_df$sexo)
##
## Wilcoxon rank sum test with continuity correction
##
## data: burnout_df$ase_total by burnout_df$sexo
## W = 393, p-value = 0.867
## alternative hypothesis: true location shift is not equal to 0
En ambas variables no se observan diferencias significativas según sexo.
# Burnout y sexo
rank_biserial("bur_total", "sexo", data = burnout_df)
El tamaño del efecto calculado puede categorizarse como pequeño
# Autoeficacia académica y sexo
rank_biserial("ase_total", "sexo", data = burnout_df)
El tamaño del efecto calculado puede categorizarse como nulo
burnout_df %>%
ggplot(aes(x = bur_total,
y = ase_total)) +
geom_point() +
geom_smooth(method = lm)
Las variables presentan una relación lineal negativa
shapiro.test(burnout_df$bur_total)
##
## Shapiro-Wilk normality test
##
## data: burnout_df$bur_total
## W = 0.89722, p-value = 3.403e-05
shapiro.test(burnout_df$ase_total)
##
## Shapiro-Wilk normality test
##
## data: burnout_df$ase_total
## W = 0.92585, p-value = 0.0005314
# Burnout
burnout_df %>%
ggplot(aes(x = bur_total)) +
geom_histogram(binwidth = 10) +
theme_bw()
# Autoeficacia académica
burnout_df %>%
ggplot(aes(x = ase_total)) +
geom_histogram(binwidth = 10) +
theme_bw()
Las variables no cumplen con el supuesto de normalidad, por lo que se utilizará una prueba no paramétrica (Spearman)
burnout_df %>%
select(bur_total, ase_total) %>%
correlate(method = "spearman")
Las variables presentan una fuerte correlación negativa es decir, a mayor puntaje burnout menor de autoeficacia académica