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)
``````##  [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)

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``````