file.choose()
[1] "C:\\Users\\LENOVO\\Documents\\R Studio work\\trabajo encargado +\\Grado_alcoholico.xlsx"
ruta_Emsamble <- "C:\\Users\\LENOVO\\Documents\\R Studio work\\trabajo encargado +\\Grado_alcoholico.xlsx"
excel_sheets(ruta_Emsamble)
[1] "VINOS POR PRUEBA FQ."
casoDBCA1 <- read_excel(ruta_Emsamble)
print(casoDBCA1)
GRADO <- factor(casoDBCA1$Grado_alcohólico_volumétrico_porcentajeVolumen)
VARi <- factor(casoDBCA1$Variedad)
GRADO1 <- as.numeric(GRADO)
par(mfrow=c(1,1))
boxplot(split(GRADO1,VARi),xlab="variedad", ylab="grado de %alcohol")
resaov<-aov(GRADO1 ~ VARi)
anova(resaov)
Analysis of Variance Table
Response: GRADO1
Df Sum Sq Mean Sq F value Pr(>F)
VARi 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 ~ VARi)
anova(euc.lm , test="F")
Analysis of Variance Table
Response: GRADO1
Df Sum Sq Mean Sq F value Pr(>F)
VARi 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))
#Prueba de Levene
leveneTest(GRADO1 ~ VARi, center = "median")
Levene's Test for Homogeneity of Variance (center = "median")
Df F value Pr(>F)
group 6 0.3228 0.9185
24
#Método de la diferencia mínima significativa, Least Significant Difference (LSD)
outLSD <-LSD.test(resaov, "VARi",console=TRUE)
outHSD<-HSD.test(resaov, "VAR",console=TRUE)
Study: resaov ~ "VAR"
HSD Test for GRADO1
Mean Square Error: 79.58183
VARi, 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, "VARi",console=TRUE)
Study: resaov ~ "VARi"
Student Newman Keuls Test
for GRADO1
Mean Square Error: 79.58183
VARi, 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, "VARi",console=TRUE)
Study: resaov ~ "VARi"
Scheffe Test for GRADO1
Mean Square Error : 79.58183
VARi, 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, "VARi",console=TRUE)
Study: resaov ~ "VARi"
Duncan's new multiple range test
for GRADO1
Mean Square Error: 79.58183
VARi, 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, "VARi", p.adj= "bon",console=TRUE)
Study: resaov ~ "VARi"
LSD t Test for GRADO1
P value adjustment method: bonferroni
Mean Square Error: 79.58183
VARi, 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= "VARi", dispersion="se", sig.level=0.05)
summary(sk)
Goups of means at sig.level = 0.05
tukey_result <- TukeyHSD(resaov, "VARi", conf.level = 0.95)
print(tukey_result)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = GRADO1 ~ VARi)
$VARi
diff lwr upr p adj
Cabernet sauvignon-Cabernet Franc -6.6000000 -30.567485 17.36749 0.9715681
Carmenere-Cabernet Franc -1.6000000 -32.980804 29.78080 0.9999980
Italia-Cabernet Franc -4.9750000 -21.306088 11.35609 0.9540023
Malbeck-Cabernet Franc 5.0666667 -15.853870 25.98720 0.9850261
Negra Criolla-Cabernet Franc 0.1777778 -15.800546 16.15610 1.0000000
Syrah-Cabernet Franc 1.7333333 -19.187203 22.65387 0.9999639
Carmenere-Cabernet sauvignon 5.0000000 -30.084806 40.08481 0.9991607
Italia-Cabernet sauvignon 1.6250000 -21.022145 24.27214 0.9999845
Malbeck-Cabernet sauvignon 11.6666667 -14.484004 37.81734 0.7793182
Negra Criolla-Cabernet sauvignon 6.7777778 -15.616318 29.17187 0.9553747
Syrah-Cabernet sauvignon 8.3333333 -17.817337 34.48400 0.9434243
Italia-Carmenere -3.3750000 -33.759333 27.00933 0.9997993
Malbeck-Carmenere 6.6666667 -26.411606 39.74494 0.9942844
Negra Criolla-Carmenere 1.7777778 -28.418415 31.97397 0.9999952
Syrah-Carmenere 3.3333333 -29.744939 36.41161 0.9998861
Malbeck-Italia 10.0416667 -9.352190 29.43552 0.6454740
Negra Criolla-Italia 5.1527778 -8.766979 19.07254 0.8916290
Syrah-Italia 6.7083333 -12.685523 26.10219 0.9186204
Negra Criolla-Malbeck -4.8888889 -23.986638 14.20886 0.9801776
Syrah-Malbeck -3.3333333 -26.723204 20.05654 0.9991607
Syrah-Negra Criolla 1.5555556 -17.542194 20.65330 0.9999673
plot(tukey_result)
ggplot(casoDBCA1, aes(x = Variedad, y = Grado_alcohólico_volumétrico_porcentajeVolumen)) +
geom_bar(stat = "identity", fill = "skyblue", color = "black") +
labs(title = "Gráfico de Barras",
x = "VARIEDAD",
y = "Grado_alcohólico_volumétrico_porcentajeVolumen")