file.choose()
[1] "C:\\Users\\Lenovo\\Downloads\\Grado_alcohólico.xlsx"
ruta_Ensamble <-"C:\\Users\\Lenovo\\Downloads\\Grado_alcohólico.xlsx"
excel_sheets(ruta_Ensamble)
[1] "VINOS POR PRUEBA FQ."
casoDBCA1<-read_excel(ruta_Ensamble)
print(casoDBCA1)
#Se crea un objeto tipo factor
GRADO<-factor(Grado_alcohólico$`Grado_alcohólico_volumétrico_%Volumen`)
VAR <-factor(Grado_alcohólico$Variedad)
#Luego el vector TIEM se convierte a un vector ALT1 de tipo numérico
GRADO1<-as.numeric(GRADO)
#Diagrama de cajas de dispersión (Box plot)
par(mfrow=c(1,1))
boxplot(split(GRADO1,VAR),xlab="variedad", ylab="grado de alcohol")
resaov<-aov(GRADO1 ~ VAR)
anova(resaov)
Analysis of Variance Table
Response: GRADO1
Df Sum Sq Mean Sq F value Pr(>F)
VAR 6 339.71 56.619 0.7115 0.6438
Residuals 24 1909.96 79.582
cv.model(resaov)
[1] 57.37486
euc.lm <- lm(GRADO1 ~ VAR)
anova(euc.lm , test="F")
Analysis of Variance Table
Response: GRADO1
Df Sum Sq Mean Sq F value Pr(>F)
VAR 6 339.71 56.619 0.7115 0.6438
Residuals 24 1909.96 79.582
shapiro.test(euc.lm$res)
Shapiro-Wilk normality test
data: euc.lm$res
W = 0.96325, p-value = 0.3548
fitb <- fitted(resaov)
res_stb <- rstandard(resaov)
plot(fitb,res_stb,xlab="Valores predichos", ylab="valores estandarizados",abline(h=0))
5.- Prueba de homocedasticidad (homogeneidad de las varianzas) #Prueba de Bartlett
#Prueba de Levene
leveneTest(GRADO1 ~ VAR, center = "median")
Levene's Test for Homogeneity of Variance (center = "median")
Df F value Pr(>F)
group 6 0.3228 0.9185
24
6.- Pruebas de comparación múltiple de medias #Método de la diferencia mínima significativa, Least Significant Difference (LSD)
outLSD <-LSD.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
LSD t Test for GRADO1
Mean Square Error: 79.58183
VAR, means and individual ( 95 %) CI
Alpha: 0.05 ; DF Error: 24
Critical Value of t: 2.063899
Groups according to probability of means differences and alpha level( 0.05 )
Treatments with the same letter are not significantly different.
outHSD<-HSD.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
HSD Test for GRADO1
Mean Square Error: 79.58183
VAR, means
Alpha: 0.05 ; DF Error: 24
Critical Value of Studentized Range: 4.541314
Groups according to probability of means differences and alpha level( 0.05 )
Treatments with the same letter are not significantly different.
SNK.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
Student Newman Keuls Test
for GRADO1
Mean Square Error: 79.58183
VAR, means
Groups according to probability of means differences and alpha level( 0.05 )
Means with the same letter are not significantly different.
scheffe.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
Scheffe Test for GRADO1
Mean Square Error : 79.58183
VAR, means
Alpha: 0.05 ; DF Error: 24
Critical Value of F: 2.508189
Groups according to probability of means differences and alpha level( 0.05 )
Means with the same letter are not significantly different.
duncan.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
Duncan's new multiple range test
for GRADO1
Mean Square Error: 79.58183
VAR, means
Groups according to probability of means differences and alpha level( 0.05 )
Means with the same letter are not significantly different.
LSD.test(resaov, "VAR", p.adj= "bon",console=TRUE)
Study: resaov ~ "VAR"
LSD t Test for GRADO1
P value adjustment method: bonferroni
Mean Square Error: 79.58183
VAR, means and individual ( 95 %) CI
Alpha: 0.05 ; DF Error: 24
Critical Value of t: 3.395988
Groups according to probability of means differences and alpha level( 0.05 )
Treatments with the same letter are not significantly different.
sk <- SK(resaov, which= "VAR", dispersion="se", sig.level=0.05)
summary(sk)