#la matriz
tabla1 <- matrix(c(71, 185, 288, 1131), ncol = 2)
#nombres
colnames(tabla1) <- c("No estres", "Estres")
rownames(tabla1) <- c("Hombre", "Mujer")
#tabla
tabla1
No estres Estres
Hombre 71 288
Mujer 185 1131
#chi2
chisq.test(tabla1)
Pearson's Chi-squared test with Yates' continuity correction
data: tabla1
X-squared = 6.6911, df = 1, p-value = 0.00969
#ANOVa para diferencias entre cursos
df <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vSwAgtf1NUgTx02XMSFe0ddcsTcIKQJ4exo5JuE-JIarEQMj5X9ffybk_fJf_r3Mg/pub?gid=1106261659&single=true&output=csv")
#cargo package
library("tidyverse")
#gather
df %>%
gather(key = "Estres", value = "N", No:Si)
#aov
aov <- aov(df1$N~df1$Nivel.academico)
#summary aov
summary(aov)
Df Sum Sq Mean Sq F value Pr(>F)
df1$Nivel.academico 5 43422 8684 0.392 0.838
Residuals 6 132847 22141
df1 %>%
ggplot(aes(x=Nivel.academico, y=N, fill=Estres)) +
geom_col()+
theme_classic()