\[Prueba t-Dos muestras independientes\]
Se propuso un plan de fertilización en papa criolla tal como se muestra a continuación:
fertilizacion <- data.frame("N"= 100,"P2o3"=50, "K2O"=100, "CaO"=30, "MgO"=24, "S"=200, "Fe"=0, "Mn"=0, "Cu"=0.30, "Zn"=200, "B"=1.2)
fertilizacion
## N P2o3 K2O CaO MgO S Fe Mn Cu Zn B
## 1 100 50 100 30 24 200 0 0 0.3 200 1.2
y se midió a los 45 y 77 días después de la siembra el peso de tubérculos (Kg/ha) más raíces encontrando los siguientes datos:
d45 = sort(c(69, 66, 72, 68, 65, 66, 67, 68, 69, 65, 66, 68, 64, 67, 60, 68), decreasing = F)
d77 = sort(c(873, 850, 832, 834, 843, 840, 855, 790, 905, 910, 920, 840, 832, 800, 759, 812), decreasing = F)
Medidas=data.frame("d45"=d45 ,"d77"=d77)
head(Medidas)
## d45 d77
## 1 60 759
## 2 64 790
## 3 65 800
## 4 65 812
## 5 66 832
## 6 66 832
Medidas= t.test(x=d45, y=d77,
alternative = "t", var.equal = T,
conf.level = 0.95); Medidas
##
## Two Sample t-test
##
## data: d45 and d77
## t = -71.308, df = 30, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -798.9321 -754.4429
## sample estimates:
## mean of x mean of y
## 66.7500 843.4375
set.seed(0)
x <- rnorm(1000)
y <- rnorm(1000, 1)
hist(x, main = "Medidas")
hist(y, add = TRUE, col = rgb(1, 0, 1, alpha = 0.5))
boxplot(d45,d77, col = c("purple","aquamarine"),
ylab = "Peso(Kg)",
main = "Medición")
legend(x="bottomright",legend = c("d45","d77"),
fill= c("purple","aquamarine"),title="Dias")
points(mean(d45),pch=18,cex=2,col="blue")
points(x= 2, mean(d77),pch=18,cex=2,col="blue")
text(x=1,y= 0.47,"Media 0.45", col="purple")
text(x=2,y= 0.38,"Media 0.35", col="aquamarine")
a<-mean(d45)
b<-mean(d77)
c<-(b-a)/100;c
## [1] 7.766875
cor.test(x= d45, y= d77, method = "spearman")
## Warning in cor.test.default(x = d45, y = d77, method = "spearman"): Cannot
## compute exact p-value with ties
##
## Spearman's rank correlation rho
##
## data: d45 and d77
## S = 7.5642, p-value = 5.488e-13
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.9888762
cor.test(x= d45, y= d77, mothod="pearson")
##
## Pearson's product-moment correlation
##
## data: d45 and d77
## t = 10.171, df = 14, p-value = 7.567e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8280228 0.9788371
## sample estimates:
## cor
## 0.9385112