Lectura de datos
df=read.csv("Tabla-4-6.csv")
df
## Posicion Carro Marca Y
## 1 1 1 C 12
## 2 1 2 D 11
## 3 1 3 A 13
## 4 1 4 B 8
## 5 2 1 B 14
## 6 2 2 C 12
## 7 2 3 D 11
## 8 2 4 A 13
## 9 3 1 A 17
## 10 3 2 B 14
## 11 3 3 C 10
## 12 3 4 D 9
## 13 4 1 D 13
## 14 4 2 A 14
## 15 4 3 B 13
## 16 4 4 C 9
df$Posicion=factor(df$Posicion)
df$Carro=factor(df$Carro)
df$Marca=factor(df$Marca)
desgaste=df$Y
Marca=df$Carro
Posicion=df$Posicion
Tratamiento=df$Marca
modelo=lm(desgaste~Tratamiento+Posicion+Marca)
anova=aov(modelo)
summary(anova)
## Df Sum Sq Mean Sq F value Pr(>F)
## Tratamiento 3 30.69 10.229 11.419 0.00683 **
## Posicion 3 6.19 2.062 2.302 0.17695
## Marca 3 38.69 12.896 14.395 0.00378 **
## Residuals 6 5.38 0.896
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
library(agricolae)
LSD_Marca=LSD.test(y=anova,trt="Tratamiento",group=T,console=T)
##
## Study: anova ~ "Tratamiento"
##
## LSD t Test for desgaste
##
## Mean Square Error: 0.8958333
##
## Tratamiento, means and individual ( 95 %) CI
##
## desgaste std r LCL UCL Min Max
## A 14.25 1.892969 4 13.092018 15.40798 13 17
## B 12.25 2.872281 4 11.092018 13.40798 8 14
## C 10.75 1.500000 4 9.592018 11.90798 9 12
## D 11.00 1.632993 4 9.842018 12.15798 9 13
##
## Alpha: 0.05 ; DF Error: 6
## Critical Value of t: 2.446912
##
## least Significant Difference: 1.637634
##
## Treatments with the same letter are not significantly different.
##
## desgaste groups
## A 14.25 a
## B 12.25 b
## D 11.00 b
## C 10.75 b
bar.group(x=LSD_Marca$groups,horiz=T,col="red",xlim=c(0,18),
xlab="Desgaste",ylab="Marca de Neumético",
main="Comparación de las marcas de neuméticos\n por medio del procedimiento LSD")
LSD_Marca=LSD.test(y=anova,trt="Marca",group=T,console=T)
##
## Study: anova ~ "Marca"
##
## LSD t Test for desgaste
##
## Mean Square Error: 0.8958333
##
## Marca, means and individual ( 95 %) CI
##
## desgaste std r LCL UCL Min Max
## 1 14.00 2.160247 4 12.842018 15.15798 12 17
## 2 12.75 1.500000 4 11.592018 13.90798 11 14
## 3 11.75 1.500000 4 10.592018 12.90798 10 13
## 4 9.75 2.217356 4 8.592018 10.90798 8 13
##
## Alpha: 0.05 ; DF Error: 6
## Critical Value of t: 2.446912
##
## least Significant Difference: 1.637634
##
## Treatments with the same letter are not significantly different.
##
## desgaste groups
## 1 14.00 a
## 2 12.75 ab
## 3 11.75 b
## 4 9.75 c
bar.group(x=LSD_Marca$groups,horiz=T,col="red",xlim=c(0,18),
xlab="Desgaste",ylab="Marca del auto",
main="Comparación de las marcas del auto\n por medio del procedimiento LSD")
## Prueba de Normalidad
qqnorm(anova$residuals,col="red",pch=9)
qqline(anova$residuals,col="blue",lwd=2)
shapiro.test(anova$residuals)
##
## Shapiro-Wilk normality test
##
## data: anova$residuals
## W = 0.92425, p-value = 0.1974
Se acepta Ho dado que el \(p_{value}> \alpha=0.05\)