file.choose()
[1] "C:\\Users\\Windows10\\Downloads\\Grado_alcohólico.xlsx"
ruta_Ensamble <-"C:\\Users\\Windows10\\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")
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)
outHSD<-HSD.test(resaov, "VAR",console=TRUE)
SNK.test(resaov, "VAR",console=TRUE)
scheffe.test(resaov, "VAR",console=TRUE)
duncan.test(resaov, "VAR",console=TRUE)
LSD.test(resaov, "VAR", p.adj= "bon",console=TRUE)
sk <- SK(resaov, which= "VAR", dispersion="se", sig.level=0.05)
summary(sk)