Tabel berikut ini merupakan data hasil eksperimen tentang efek daya terhadap laju pemotongan bahan. Daya memiliki empat tarat yaitu 160W, 180W, 200W, dan 220W. Sedangkan laju pemotongan bahan diukur dalam satuan menit. Eksperimen menggunakan lima buah replikasi.

Penyusunan data dan analisis varians

perlakuan <- rep(c(1,2,3,4), each =5)
daya <- factor(perlakuan, levels = c(1,2,3,4), labels = c("160W","180W", "200W", "220W") )
laju <- c(575, 542, 530, 539, 570,
          565, 593, 590, 579, 610,
          600, 651, 610, 637, 629,
          725, 700, 715, 685, 710)
dataeksp <- data.frame(daya, laju)
anv <- aov(laju ~ daya, data = dataeksp)
output <- anova(anv)
output
Analysis of Variance Table

Response: laju
          Df Sum Sq Mean Sq F value    Pr(>F)    
daya       3  66871 22290.2  66.797 2.883e-09 ***
Residuals 16   5339   333.7                      
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Nilai yang diperlukan untuk uji lanjut

RJKE <- output$`Mean Sq`[2]
dkE <- output$Df[2]
k <- length(levels(daya)) # banyaknya taraf perlakuan
n <- 5 # banyaknya replikasi

Uji Lanjut Tukey

library(agricolae)
tukey <- HSD.test(anv, "daya", alpha = 0.05, group = FALSE)
print(tukey)
$statistics
  MSerror Df   Mean       CV      MSD
    333.7 16 617.75 2.957095 33.05438

$parameters
   test name.t ntr StudentizedRange alpha
  Tukey   daya   4         4.046093  0.05

$means
      laju      std r Min Max Q25 Q50 Q75
160W 551.2 20.01749 5 530 575 539 542 570
180W 587.4 16.74216 5 565 610 579 590 593
200W 625.4 20.52559 5 600 651 610 629 637
220W 707.0 15.24795 5 685 725 700 710 715

$comparison
            difference pvalue signif.        LCL         UCL
160W - 180W      -36.2 0.0294       *  -69.25438   -3.145624
160W - 200W      -74.2 0.0000     *** -107.25438  -41.145624
160W - 220W     -155.8 0.0000     *** -188.85438 -122.745624
180W - 200W      -38.0 0.0216       *  -71.05438   -4.945624
180W - 220W     -119.6 0.0000     *** -152.65438  -86.545624
200W - 220W      -81.6 0.0000     *** -114.65438  -48.545624

$groups
NULL

attr(,"class")
[1] "group"

Uji Lanjut Kontras

Susun kontras

c1 <- c(1, -1, 0, 0)
c2 <- c(1, 1, -1, -1)
c3 <- c(0, 0, 1, -1)
contrastmat <- cbind(c1,c2,c3)

rataan <- aggregate(dataeksp$laju, by = list(dataeksp$daya), FUN = "mean")
C <- rataan$x %*% contrastmat

sigmac2 <- (1/n)*colSums(contrastmat^2)
F_hitung <- (C^2/sigmac2)/RJKE
Ftabel <- qf(1 - 0.05, 1, dkE)
F_hitung
           c1       c2       c3
[1,] 9.817501 140.6894 49.88433
Ftabel
[1] 4.493998

Uji Lanjut Scheffe

# Susun kontras
c11 <- c(1, 1, -1, -1)
c22 <- c(1, 0, 0, -1)
matriks.c <- cbind(c11,c22)
colnames(matriks.c) <- c("c1","c2")

Cs <- rataan$x %*%matriks.c
SC <- sqrt(RJKE *(1/n)*colSums(matriks.c^2))
SCalpha <- SC * sqrt((k-1)*qf((1-0.01), (k - 1), (k*n) - k))

kesimpulan <- rep(0,2)
for (i in 1:2){
  kesimpulan[i] <- if(abs(as.vector(Cs)[i]) > as.vector(SCalpha)[i]) {print('H0 ditolak')} else {print('H0 diterima')}
}
[1] "H0 ditolak"
[1] "H0 ditolak"
results <- data.frame(abs(as.vector(Cs)), SCalpha, kesimpulan)
colnames(results) <- c("| C |", "S.alpha", "Keputusan")
results
NA
LS0tDQp0aXRsZTogIkt1bmNpIEphd2FiYW4gUHJha3Rpa3VtIGtlLTMgKFVqaSBMYW5qdXQgVHVrZXksIEtvbnRyYXMgZGFuIFNjaGVmZmUpIC0gVW50dWsgcGVnYW5nYW4gYXNsYWIgdGlkYWsgdW50dWsgZGliYWdpa2FuIGtlcGFkYSBwZXNlcnRhIHByYWt0aWt1bSIgDQphdXRob3I6IEJ1ZGhpIEhhbmRva28sIE0uU2kNCm91dHB1dDogaHRtbF9ub3RlYm9vaw0KLS0tDQoNClRhYmVs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