Punto 1
Hipotesis estadísticas: Ho=Las aveztruces no poseen mecanismos para reducir la temperatura de su cerebro. Ha=Las aveztruces si poseen mecanismos para reducir la temperatura de su cerebro.
Hipotesis cientifica:Las aveztruces pueden modificar la temperatura de su
library(ggplot2)
t_corporal=c(38.51,38.45,38.27,38.52,38.62,38.68)
t_cerebral=c(39.32,39.21,39.2,38.68,39.09,38.94)
media_corporal=mean(t_corporal)
media_cerebral=mean(t_cerebral)
sd_corporal=sd(t_corporal)
hist_corporal=qplot(sd_corporal,color=I('black'),fill=I('grey'),xlab='Temperatura corporal (°C)',ylab='Frecuencia')+theme_minimal()
hist_corporal
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
sd_cerebral=sd(t_cerebral)
hist_cerebral=qplot(sd_cerebral,color=I('black'),fill=I('grey'),xlab='Temperatura cerebral (°C)', ylab='Frecuencia')+theme_minimal()
hist_cerebral
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
norm_corporal=rnorm(1000, mean=media_corporal,sd=sd_corporal)
histnorm_corporal=qplot(norm_corporal,color=I('black'),fill=I('blue'),xlab='Temperatura corporal (°C)',ylab='Frecuencia')+theme_minimal()
histnorm_corporal
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
norm_cerebral=rnorm(1000, mean=media_cerebral,sd=sd_cerebral)
histnorm_cerebral=qplot(norm_cerebral,color=I('black'),fill=I('blue'),xlab='Temperatura cerebral (°C)',ylab='Frecuencia')+theme_minimal()
histnorm_cerebral
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
norm_corporal=rnorm(1000, mean=media_corporal,sd=sd_corporal)
histnorm_corporal=qplot(norm_corporal,color=I('black'),fill=I('blue'),xlab='Temperatura corporal (°C)',ylab='Frecuencia')+theme_minimal()
histnorm_corporal
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
norm_cerebral=rnorm(1000, mean=media_cerebral,sd=sd_cerebral)
histnorm_corporal=qplot(norm_cerebral,color=I('black'),fill=I('blue'),xlab='Temperatura cerebral (°C)',ylab='Frecuencia')+theme_minimal()
histnorm_cerebral
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
shapiro.test(norm_corporal)
##
## Shapiro-Wilk normality test
##
## data: norm_corporal
## W = 0.99895, p-value = 0.8462
shapiro.test(norm_cerebral)
##
## Shapiro-Wilk normality test
##
## data: norm_cerebral
## W = 0.99853, p-value = 0.5725
Punto 2 Hipotesis cientifica: La velocidad en el Syrupo podria incrementar debido a que la friccion del cuerpo podria compensar el incremneto de fuerza de cada brazada. Hipotesis nula: La velocidad de nado en el “Syrup” es igual que en el agua. Hipotesis alternativa: La velocidad de nado en el “Syrup” es menor que en el agua. Valor de sigificancia: 0.01, escojimos este valor para que se mas dificil rechazar la hipotesis nula
Nivel de confianza:0.99
library(ggplot2)
velocidad= c(1.08, 0.94, 1.07, 1.04, 1.02, 1.01, 0.95, 1.02, 1.08, 1.02, 1.01, 0.96 ,1.04 ,1.02, 1.02, 0.9, 0.98, 0.99)
velocidad
## [1] 1.08 0.94 1.07 1.04 1.02 1.01 0.95 1.02 1.08 1.02 1.01 0.96 1.04 1.02 1.02
## [16] 0.90 0.98 0.99
vel_mean= mean(velocidad)
vel_sd= sd(velocidad)
set.seed(1994)
vel_rand= rnorm(5000, mean=vel_mean, sd=vel_sd)
vel_lrand= rlnorm(5000, mean=vel_mean, sd=vel_sd)
qplot(vel_rand, bins=30, color = I('black'), fill = I('grey'), xlab = "Velocidad de nado en Syrup", ylab = 'Frecuencia') + theme_minimal()
vel_range= seq(0,1.5,.01)
vel_pdf= dnorm(vel_range, mean=vel_mean, sd=vel_sd)
qplot(x = vel_range, y = vel_pdf, geom = c('point', 'line'), xlab = "Velocidad de nado en Syrup", ylab = 'Probabilidad') + theme_minimal()
par(mfrow=c(1,2))
norm_hist_vel = qplot(vel_rand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1')), y = 'Frecuencia') +theme_minimal()
norm_hist_vel
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
norm_hist_vel
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
lnorm_hist_vel= qplot(vel_lrand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1')), y = 'Frecuencia') +theme_minimal()
lnorm_hist_vel
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
##QQ
norm_qq_vel= ggplot()+ xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample =vel_rand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1'))) + theme_minimal()
norm_qq_vel
lnorm_qq_vel =ggplot() + xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample= vel_lrand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1'))) + theme_minimal()
lnorm_qq_vel
##Shapiro
shapiro.test(vel_lrand)
##
## Shapiro-Wilk normality test
##
## data: vel_lrand
## W = 0.99777, p-value = 1.16e-06
shapiro.test(vel_rand)
##
## Shapiro-Wilk normality test
##
## data: vel_rand
## W = 0.99964, p-value = 0.5383
Teniendo en cuenta las graficas y el test de shapiro se puede evidenciar que la distribucion Log-Normal no esta centrada por lo que se deben aplicar transformaciones para que sea normal.
#Transformaciones
library(ggplot2)
log_lnorm_rand_vel= log(vel_lrand)
log_lnorm_hist_vel= qplot(log_lnorm_rand_vel, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1')), y = 'Frecuencia') + theme_minimal()
log_lnorm_hist_vel
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
log_lnorm_qq_vel=ggplot() + aes(sample = log_lnorm_rand_vel) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1'))) + theme_minimal()
log_lnorm_qq_vel
shapiro.test(log_lnorm_rand_vel)
##
## Shapiro-Wilk normality test
##
## data: log_lnorm_rand_vel
## W = 0.99967, p-value = 0.6247
t-test:
#ttest one sample
t.test(velocidad, mu=1, alternative="less", conf.level = 0.99)
##
## One Sample t-test
##
## data: velocidad
## t = 0.72841, df = 17, p-value = 0.7619
## alternative hypothesis: true mean is less than 1
## 99 percent confidence interval:
## -Inf 1.0377
## sample estimates:
## mean of x
## 1.008333
0.72841<0.7619 Como el valor t calculado es menor que el valor p, se deduce que no hay una diferencia significativa, por lo que no se rechaza la hipotesis nula. Es decir que no hay una diferencia de velocidad entre el nado en Syrup y el nado en agua.
Punto 3 Hipotesis cientifica: Los niveles de la hormona GnRH eta relacionada con el desarrollo de la genitalia de los peces y en consecuencia a si los machos tienen o no territorio
Hipotesis nula: Los machos sin territorio tiene los mismos niveles de la hormona GnRH que los machos con territorio Hipotesis alternativa: Los machos sin territorio tienen niveles mas bajos de la hormona GnRH que los macho con territorio Valor de sigificancia: 0.01, escojimos este valor para que se mas dificil rechazar la hipotesis nula
Nivel de confianza:0.99
peces= read.table("C:\\Users\\USUARIO\\Documents\\Uni 2021-2\\Inferencia e informatica\\pecess1.txt", header=T)
peces
## Estatus_territorial Nivel_mRNA_GnRH
## 1 NT 0.504
## 2 NT 0.432
## 3 NT 0.744
## 4 NT 0.792
## 5 NT 0.672
## 6 NT 1.344
## 7 T 1.152
## 8 T 1.272
## 9 T 2.328
## 10 T 3.288
## 11 T 0.888
peces_nt= subset(peces, Estatus_territorial=="NT")
peces_t=subset(peces, Estatus_territorial=="T")
peces_ntmean= mean(peces_nt$Nivel_mRNA_GnRH)
peces_ntsd= sd(peces_nt$Nivel_mRNA_GnRH)
peces_tmean= mean(peces_t$Nivel_mRNA_GnRH)
peces_tsd= sd(peces_t$Nivel_mRNA_GnRH)
Debido a que son dos muestras independintes(machos con y sin territorio) se evaluo por separado la normalidad de los dos grupos.
Normalidad machos sin terriotorio:
library(ggplot2)
set.seed(1994)
peces_ntrand= rnorm(5000, mean=peces_ntmean, sd=peces_ntsd)
peces_ntlrand= rlnorm(5000, mean=peces_ntmean, sd=peces_ntsd)
qplot(peces_ntrand, bins=30, color = I('black'), fill = I('grey'), xlab = "Nivel de mRNA de GnRH en machos sin territorio", ylab = 'Frecuencia') + theme_minimal()
peces_ntrange= seq(0,1.5,.01)
peces_ntrange
## [1] 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14
## [16] 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29
## [31] 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44
## [46] 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59
## [61] 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74
## [76] 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89
## [91] 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 1.01 1.02 1.03 1.04
## [106] 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19
## [121] 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34
## [136] 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49
## [151] 1.50
peces_ntpdf= dnorm(peces_ntrange, mean= peces_ntmean, sd =peces_ntsd)
peces_ntpdf
## [1] 0.08480586 0.09105716 0.09767572 0.10467511 0.11206874 0.11986982
## [7] 0.12809125 0.13674560 0.14584500 0.15540107 0.16542484 0.17592669
## [13] 0.18691623 0.19840224 0.21039258 0.22289408 0.23591248 0.24945234
## [19] 0.26351694 0.27810817 0.29322652 0.30887092 0.32503870 0.34172552
## [25] 0.35892525 0.37662999 0.39482992 0.41351330 0.43266643 0.45227355
## [31] 0.47231686 0.49277651 0.51363051 0.53485481 0.55642326 0.57830764
## [37] 0.60047766 0.62290104 0.64554353 0.66836899 0.69133942 0.71441511
## [43] 0.73755467 0.76071517 0.78385226 0.80692028 0.82987241 0.85266079
## [49] 0.87523674 0.89755085 0.91955320 0.94119354 0.96242144 0.98318653
## [55] 1.00343865 1.02312809 1.04220576 1.06062340 1.07833380 1.09529097
## [61] 1.11145037 1.12676907 1.14120597 1.15472198 1.16728017 1.17884595
## [67] 1.18938726 1.19887467 1.20728156 1.21458419 1.22076187 1.22579703
## [73] 1.22967531 1.23238560 1.23392015 1.23427455 1.23344778 1.23144222
## [79] 1.22826361 1.22392106 1.21842699 1.21179704 1.20405005 1.19520795
## [85] 1.18529562 1.17434084 1.16237410 1.14942850 1.13553958 1.12074515
## [91] 1.10508513 1.08860137 1.07133748 1.05333859 1.03465121 1.01532300
## [97] 0.99540255 0.97493925 0.95398300 0.93258407 0.91079288 0.88865981
## [103] 0.86623500 0.84356819 0.82070851 0.79770434 0.77460313 0.75145127
## [109] 0.72829389 0.70517482 0.68213635 0.65921924 0.63646251 0.61390343
## [115] 0.59157739 0.56951787 0.54775634 0.52632228 0.50524308 0.48454405
## [121] 0.46424842 0.44437731 0.42494977 0.40598277 0.38749123 0.36948808
## [127] 0.35198427 0.33498886 0.31850903 0.30255017 0.28711596 0.27220842
## [133] 0.25782798 0.24397359 0.23064277 0.21783175 0.20553546 0.19374774
## [139] 0.18246131 0.17166795 0.16135853 0.15152312 0.14215108 0.13323112
## [145] 0.12475142 0.11669966 0.10906313 0.10182879 0.09498335 0.08851333
## [151] 0.08240511
qplot(x = peces_ntrange, y = peces_ntpdf, geom = c('point', 'line'), xlab = "Nivel de mRNA de GnRH en machos sin territorio", ylab = 'Probabilidad') + theme_minimal()
par(mfrow=c(1,2))
norm_hist_nt = qplot(peces_ntrand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1')), y = 'Frecuencia') +theme_minimal()
norm_hist_nt
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
lnorm_hist_nt= qplot(peces_ntlrand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1')), y = 'Frecuencia') +theme_minimal()
lnorm_hist_nt
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
##QQ
norm_qq_nt= ggplot()+ xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample =peces_ntrand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1'))) + theme_minimal()
norm_qq_nt
lnorm_qq_nt =ggplot() + xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample= peces_ntlrand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1'))) + theme_minimal()
lnorm_qq_nt
##Shapiro
shapiro.test(peces_ntrand)
##
## Shapiro-Wilk normality test
##
## data: peces_ntrand
## W = 0.99964, p-value = 0.5383
shapiro.test(peces_ntlrand)
##
## Shapiro-Wilk normality test
##
## data: peces_ntlrand
## W = 0.94572, p-value < 2.2e-16
#Transformaciones
log_lnorm_rand_nt= log(peces_ntlrand)
log_lnorm_hist_nt= qplot(log_lnorm_rand_nt, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1')), y = 'Frecuencia') + theme_minimal()
log_lnorm_hist_nt
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
log_lnorm_qq_nt=ggplot() + aes(sample = log_lnorm_rand_nt) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1'))) + theme_minimal()
log_lnorm_qq_nt
shapiro.test(log_lnorm_rand_nt)
##
## Shapiro-Wilk normality test
##
## data: log_lnorm_rand_nt
## W = 0.99967, p-value = 0.6247
Normalidad machos con terriotorio:
##T
library(ggplot2)
peces_trand= rnorm(5000, mean=peces_tmean, sd=peces_tsd)
peces_tlrand= rlnorm(5000, mean=peces_tmean, sd=peces_tsd)
qplot(peces_trand, bins=30, color = I('black'), fill = I('grey'), xlab = "Nivel de mRNA de GnRH en machos con territorio", ylab = 'Frecuencia') + theme_minimal()
peces_trange= seq(0,1.5,.01)
peces_trange
## [1] 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14
## [16] 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29
## [31] 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44
## [46] 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59
## [61] 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74
## [76] 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89
## [91] 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 1.01 1.02 1.03 1.04
## [106] 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19
## [121] 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34
## [136] 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49
## [151] 1.50
peces_tpdf= dnorm(peces_trange, mean= peces_tmean, sd =peces_tsd)
peces_tpdf
## [1] 0.08150773 0.08296386 0.08443760 0.08592897 0.08743800 0.08896467
## [7] 0.09050900 0.09207098 0.09365060 0.09524785 0.09686271 0.09849516
## [13] 0.10014515 0.10181266 0.10349765 0.10520006 0.10691983 0.10865692
## [19] 0.11041125 0.11218274 0.11397133 0.11577691 0.11759941 0.11943872
## [25] 0.12129473 0.12316733 0.12505641 0.12696183 0.12888347 0.13082119
## [31] 0.13277483 0.13474425 0.13672928 0.13872975 0.14074550 0.14277634
## [37] 0.14482208 0.14688253 0.14895747 0.15104671 0.15315002 0.15526717
## [43] 0.15739794 0.15954209 0.16169936 0.16386950 0.16605226 0.16824736
## [49] 0.17045452 0.17267347 0.17490391 0.17714554 0.17939806 0.18166115
## [55] 0.18393451 0.18621779 0.18851067 0.19081280 0.19312385 0.19544344
## [61] 0.19777123 0.20010685 0.20244991 0.20480004 0.20715685 0.20951994
## [67] 0.21188892 0.21426337 0.21664289 0.21902706 0.22141544 0.22380760
## [73] 0.22620312 0.22860154 0.23100242 0.23340530 0.23580973 0.23821523
## [79] 0.24062134 0.24302759 0.24543349 0.24783856 0.25024231 0.25264426
## [85] 0.25504389 0.25744071 0.25983421 0.26222389 0.26460924 0.26698973
## [91] 0.26936484 0.27173406 0.27409686 0.27645272 0.27880109 0.28114146
## [97] 0.28347327 0.28579601 0.28810913 0.29041208 0.29270434 0.29498535
## [103] 0.29725457 0.29951147 0.30175549 0.30398609 0.30620273 0.30840486
## [109] 0.31059194 0.31276343 0.31491878 0.31705745 0.31917890 0.32128260
## [115] 0.32336800 0.32543458 0.32748179 0.32950911 0.33151602 0.33350198
## [121] 0.33546647 0.33740898 0.33932900 0.34122600 0.34309949 0.34494896
## [127] 0.34677391 0.34857385 0.35034829 0.35209675 0.35381875 0.35551381
## [133] 0.35718147 0.35882127 0.36043276 0.36201547 0.36356898 0.36509285
## [139] 0.36658665 0.36804996 0.36948237 0.37088346 0.37225285 0.37359014
## [145] 0.37489495 0.37616691 0.37740565 0.37861082 0.37978207 0.38091905
## [151] 0.38202145
qplot(x = peces_trange, y = peces_tpdf, geom = c('point', 'line'), xlab = "Nivel de mRNA de GnRH en machos con territorio", ylab = 'Probabilidad') + theme_minimal()
par(mfrow=c(1,2))
norm_hist_t = qplot(peces_trand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1')), y = 'Frecuencia') +theme_minimal()
norm_hist_t
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
lnorm_hist_t= qplot(peces_tlrand, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1')), y = 'Frecuencia') +theme_minimal()
lnorm_hist_t
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
##QQ
norm_qq_t= ggplot()+ xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample =peces_trand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Normal ', mu, ' = 0, ', sigma,' = 1'))) + theme_minimal()
norm_qq_t
lnorm_qq_t =ggplot() + xlab("Cuantil teórico") + ylab ("Muestra") + aes(sample= peces_tlrand) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal ', mu, ' = 0, ',sigma, ' = 1'))) + theme_minimal()
lnorm_qq_t
##Shapiro
shapiro.test(peces_trand)
##
## Shapiro-Wilk normality test
##
## data: peces_trand
## W = 0.99973, p-value = 0.8022
shapiro.test(peces_tlrand)
##
## Shapiro-Wilk normality test
##
## data: peces_tlrand
## W = 0.59336, p-value < 2.2e-16
#Transformaciones
log_lnorm_rand_t= log(peces_tlrand)
log_lnorm_hist_t= qplot(log_lnorm_rand_t, color = I('black'), fill = I('grey')) +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1')), y = 'Frecuencia') + theme_minimal()
log_lnorm_hist_t
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
log_lnorm_qq_t=ggplot() + aes(sample = log_lnorm_rand_t) +stat_qq() + stat_qq_line() +labs(title = expression(paste('Distribución Log-Normal Transformada ', mu,' = 0, ', sigma, ' = 1'))) + theme_minimal()
log_lnorm_qq_t
shapiro.test(log_lnorm_rand_t)
##
## Shapiro-Wilk normality test
##
## data: log_lnorm_rand_t
## W = 0.9996, p-value = 0.4098
Debido a que son datos independientes se debe primero hacer un test F para verificar que ambos datos tengan la misma varianza.
var.test(peces$Nivel_mRNA_GnRH ~ peces$Estatus_territorial, conf.level=0.99)
##
## F test to compare two variances
##
## data: peces$Nivel_mRNA_GnRH by peces$Estatus_territorial
## F = 0.10389, num df = 5, denom df = 4, p-value = 0.02878
## alternative hypothesis: true ratio of variances is not equal to 1
## 99 percent confidence interval:
## 0.004626178 1.616078997
## sample estimates:
## ratio of variances
## 0.1038874
Se puede evidenciar que las varianzas son iguales por lo que se puede realizar una prueba t de datos independientes.
library(ggplot2)
t.test(peces$Nivel_mRNA_GnRH ~ peces$Estatus_territorial, var.equal=T, alternative="less", conf.level=0.99)
##
## Two Sample t-test
##
## data: peces$Nivel_mRNA_GnRH by peces$Estatus_territorial
## t = -2.4114, df = 9, p-value = 0.01958
## alternative hypothesis: true difference in means is less than 0
## 99 percent confidence interval:
## -Inf 0.1764473
## sample estimates:
## mean in group NT mean in group T
## 0.7480 1.7856
ggplot(peces)+geom_histogram(bins=4,aes(Nivel_mRNA_GnRH, fill =Estatus_territorial ), color = 'black') +labs(x = "Nivel de mRNA de GnRH", y = 'Frecuencia', title = "Nivel de mRNA de GnRH de los machos") +theme_minimal()
Teniendo en cuenta los datos proporcionados por la prueba t, podemos concluir que no se rechaza la hipotesis nula. Por lo que podemos deducir que la no hay una diferencia en los niveles de la hormona GnRH entre los machos con y sin territorio.
En la grafica no e puede evidenciar claramente que estos niveles son iguales, esto puede ocurri debido a la poca cantidad de datos.