# Faktor
#Membentuk kolom faktor Pupuk (A) dengan 12 kombinasi A–B, masing-masing diulang 4 kali sesuai jumlah kelompok (K = 4).
A <- rep(c("Kontrol","Kontrol","PK","PK","N","N","NP","NP","NK","NK","NPK","NPK"), each = 4)
#Membentuk kolom Genotipe (B) yang berpasangan dengan faktor A. sesuai banyaknya kelompok
B <- rep(rep(c("IR64","S969"), each = 4), 6)
#kelompok Membuat kolom blok (ulangan) K = 1,2,3,4 untuk setiap kombinasi A–B.
K <- rep(1:4, times = 12)
# Respon hasil padi
Y <- c(
20.7,32.1,29.5,37.7, # Kontrol - IR64
27.7,33.0,26.3,37.7, # Kontrol - S969
30.0,30.7,25.5,36.9, # PK - IR64
36.6,33.8,27.0,39.0, # PK - S969
39.9,41.5,46.4,44.5, # N - IR64
37.4,41.2,45.4,44.6, # N - S969
40.8,43.5,43.3,43.4, # NP - IR64
42.2,46.0,45.9,46.2, # NP - S969
42.4,45.6,44.8,47.0, # NK - IR64
39.8,39.5,40.9,44.0, # NK - S969
48.6,49.8,42.6,46.6, # NPK - IR64
42.9,45.9,43.9,45.6 # NPK - S969
)
data <- data.frame(K = factor(K),
A = factor(A),
B = factor(B),
Y = Y)
data
## K A B Y
## 1 1 Kontrol IR64 20.7
## 2 2 Kontrol IR64 32.1
## 3 3 Kontrol IR64 29.5
## 4 4 Kontrol IR64 37.7
## 5 1 Kontrol S969 27.7
## 6 2 Kontrol S969 33.0
## 7 3 Kontrol S969 26.3
## 8 4 Kontrol S969 37.7
## 9 1 PK IR64 30.0
## 10 2 PK IR64 30.7
## 11 3 PK IR64 25.5
## 12 4 PK IR64 36.9
## 13 1 PK S969 36.6
## 14 2 PK S969 33.8
## 15 3 PK S969 27.0
## 16 4 PK S969 39.0
## 17 1 N IR64 39.9
## 18 2 N IR64 41.5
## 19 3 N IR64 46.4
## 20 4 N IR64 44.5
## 21 1 N S969 37.4
## 22 2 N S969 41.2
## 23 3 N S969 45.4
## 24 4 N S969 44.6
## 25 1 NP IR64 40.8
## 26 2 NP IR64 43.5
## 27 3 NP IR64 43.3
## 28 4 NP IR64 43.4
## 29 1 NP S969 42.2
## 30 2 NP S969 46.0
## 31 3 NP S969 45.9
## 32 4 NP S969 46.2
## 33 1 NK IR64 42.4
## 34 2 NK IR64 45.6
## 35 3 NK IR64 44.8
## 36 4 NK IR64 47.0
## 37 1 NK S969 39.8
## 38 2 NK S969 39.5
## 39 3 NK S969 40.9
## 40 4 NK S969 44.0
## 41 1 NPK IR64 48.6
## 42 2 NPK IR64 49.8
## 43 3 NPK IR64 42.6
## 44 4 NPK IR64 46.6
## 45 1 NPK S969 42.9
## 46 2 NPK S969 45.9
## 47 3 NPK S969 43.9
## 48 4 NPK S969 45.6
model <- aov(Y ~ A*B + Error(K/(A + B)), data = data)
summary(model)
##
## Error: K
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 3 197.1 65.7
##
## Error: K:A
## Df Sum Sq Mean Sq F value Pr(>F)
## A 5 1674.8 335.0 18.77 5.62e-06 ***
## Residuals 15 267.7 17.8
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Error: K:B
## Df Sum Sq Mean Sq F value Pr(>F)
## B 1 0.035 0.0352 0.032 0.87
## Residuals 3 3.329 1.1097
##
## Error: Within
## Df Sum Sq Mean Sq F value Pr(>F)
## A:B 5 78.59 15.72 4.504 0.0105 *
## Residuals 15 52.35 3.49
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model$`Error: K:A`)
## Length Class Mode
## 0 NULL NULL
summary(model$`Error: K:B`)
## Length Class Mode
## 0 NULL NULL
summary(model$`Error: Within`)
## Length Class Mode
## 0 NULL NULL
interaction.plot(data$A, data$B, data$Y,
xlab="Pupuk (A)", trace.label="Genotipe (B)",
ylab="Rata-rata hasil")
Grafik interaksi menunjukkan bahwa jenis pupuk memberikan pengaruh yang kuat terhadap hasil padi, ditandai dengan peningkatan hasil yang konsisten pada kedua genotipe setelah diberi pupuk N, NK, NP, dan NPK. Perbedaan hasil antara genotipe IR-64 dan S-969 relatif kecil sehingga pengaruh genotipe secara umum tidak signifikan. Namun, garis kedua genotipe tidak sejajar dan bersilangan, terutama pada perlakuan NPK, sehingga menunjukkan adanya interaksi. Hal ini berarti respons kedua genotipe terhadap pupuk tidak sepenuhnya sama, dan efektivitas pupuk tertentu dapat berbeda antar genotipe.