library(readxl)
library(ggplot2)
xd <- read_excel("~/Universidad Javeriana/Forma y Funcion Animal/xd.xlsx")
View(xd)
Comparación de medias del umbral mínimo entre hombres y mujeres.
attach(xd)
hombre=subset(xd,Sexo=="M")
mujer=subset(xd,Sexo=="F")
minimoM=c(hombre$Frec_Min,hombre$`Frec. Min2`,hombre$`Frec. Min4`,hombre$`Frec. Min6`)
minimoF=c(mujer$Frec_Min,mujer$`Frec. Min2`,mujer$`Frec. Min4`,mujer$`Frec. Min6`)
shapiro.test(minimoF)
##
## Shapiro-Wilk normality test
##
## data: minimoF
## W = 0.92882, p-value = 0.1465
shapiro.test(minimoM)
##
## Shapiro-Wilk normality test
##
## data: minimoM
## W = 0.85148, p-value = 0.00233
var.test(minimoM,minimoF)
##
## F test to compare two variances
##
## data: minimoM and minimoF
## F = 1.7382, num df = 23, denom df = 19, p-value = 0.2248
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
## 0.7052068 4.1272631
## sample estimates:
## ratio of variances
## 1.738186
wilcox.test(minimoM,minimoF,paired = FALSE)
## Warning in wilcox.test.default(minimoM, minimoF, paired = FALSE): cannot compute
## exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: minimoM and minimoF
## W = 252, p-value = 0.7863
## alternative hypothesis: true location shift is not equal to 0
Comparación de medias del umbral máximo entre hombres y mujeres.
attach(xd)
## The following objects are masked from xd (pos = 3):
##
## Frec. Max, Frec. Max3, Frec. Max5, Frec. Max7, Frec. Min2, Frec.
## Min4, Frec. Min6, Frec_Min, Sexo
maximoM=c(hombre$`Frec. Max`,hombre$`Frec. Max3`,hombre$`Frec. Max5`,hombre$`Frec. Max7`)
maximoF=c(mujer$`Frec. Max`,mujer$`Frec. Max3`,mujer$`Frec. Max5`,mujer$`Frec. Max7`)
shapiro.test(maximoM)
##
## Shapiro-Wilk normality test
##
## data: maximoM
## W = 0.96877, p-value = 0.6366
shapiro.test(maximoF)
##
## Shapiro-Wilk normality test
##
## data: maximoF
## W = 0.94296, p-value = 0.2726
var.test(maximoM,maximoF)
##
## F test to compare two variances
##
## data: maximoM and maximoF
## F = 1.355, num df = 23, denom df = 19, p-value = 0.5053
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
## 0.549749 3.217438
## sample estimates:
## ratio of variances
## 1.355015
t.test(maximoM,maximoF,paired = FALSE,var.equal = TRUE)
##
## Two Sample t-test
##
## data: maximoM and maximoF
## t = 1.2994, df = 42, p-value = 0.2009
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -318.1433 1468.5099
## sample estimates:
## mean of x mean of y
## 16627.08 16051.90