file.choose()
[1] "C:\\Users\\Usuario\\Downloads\\Grado_alcohólico.xlsx"
ruta_Ensamble <-"C:\\Users\\Usuario\\Downloads\\Grado_alcohólico.xlsx"
excel_sheets(ruta_Ensamble )
[1] "VINOS POR PRUEBA FQ."
casoDBCA1<-read_excel(ruta_Ensamble)
print(casoDBCA1)
#secrea un objeto tipo factor
VARD<-factor(casoDBCA1$Variedad)
GRADVOL<- as.vector(casoDBCA1$`Grado_alcohólico_volumétrico_%Volumen`)
#Luego el vector TIEM se convierte a un vector ALT1 de tipo numérico
GRADVOL1<-as.numeric(GRADVOL)
#Diagrama de cajas de dispersión (Box plot)
par(mfrow=c(1,1))
boxplot(split(GRADVOL1,VARD),xlab="Variedad", ylab="`Grado_alcohólico_volumétrico_%Volumen`")
resaov<-aov(GRADVOL1 ~ VARD)
anova(resaov)
Analysis of Variance Table
Response: GRADVOL1
Df Sum Sq Mean Sq F value Pr(>F)
VARD 6 3.3901 0.56502 0.7298 0.6302
Residuals 24 18.5813 0.77422
3.- Análisis de varianza usando la función modelo lineal (lm) Linear model #Coeficiente de variación
cv.model(resaov)
[1] 6.887564
euc.lm <- lm(GRADVOL1 ~ VARD )
anova(euc.lm , test="F")
Analysis of Variance Table
Response: GRADVOL1
Df Sum Sq Mean Sq F value Pr(>F)
VARD 6 3.3901 0.56502 0.7298 0.6302
Residuals 24 18.5813 0.77422
4.- Evaluación de los Supuestos del modelo estadístico matemático #Prueba de normalidad Shapiro-Wilk
shapiro.test(euc.lm$res)
Shapiro-Wilk normality test
data: euc.lm$res
W = 0.94655, p-value = 0.1253
fitb <- fitted(resaov)
res_stb <- rstandard(resaov)
plot(fitb,res_stb,xlab="Valores predichos", ylab="Residuos estandarizados",abline(h=0))
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, "VARD",console=TRUE)
Study: resaov ~ "VARD"
LSD t Test for GRADVOL1
Mean Square Error: 0.7742194
VARD, 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, "VARD",console=TRUE)
Study: resaov ~ "VARD"
HSD Test for GRADVOL1
Mean Square Error: 0.7742194
VARD, 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, "VARD",console=TRUE)
Study: resaov ~ "VARD"
Student Newman Keuls Test
for GRADVOL1
Mean Square Error: 0.7742194
VARD, 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, "VARD",console=TRUE)
Study: resaov ~ "VARD"
Scheffe Test for GRADVOL1
Mean Square Error : 0.7742194
VARD, 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, "VARD",console=TRUE)
Study: resaov ~ "VARD"
Duncan's new multiple range test
for GRADVOL1
Mean Square Error: 0.7742194
VARD, 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, "VARD", p.adj= "bon",console=TRUE)
Study: resaov ~ "VARD"
LSD t Test for GRADVOL1
P value adjustment method: bonferroni
Mean Square Error: 0.7742194
VARD, 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.