Give TWO conditions of balanced incomplete block design :
-any two treatments appear together an equal number of times
-not all treatments runs in each block
Response variable : strength of the paper
Treatment=hardwood concentrations, list = 2,4,6,8,10,12,14
#import data
library(readr)
data <- read_csv("/Volumes/GoogleDrive/My Drive/NORATIKAH/EDA/Assessments/Lab Report/Lab Report 3/Lab Report 3 v2.csv")
── Column specification ───────────────────────────────────────────────────────────────────────────────
cols(
Days = col_double(),
Hardwood = col_double(),
Strength = col_double()
)
data
Treatment = as.factor(data$Hardwood)
Block = as.factor(data$Days)
#for BIBD, block come first then treatment
results = aov(Strength~Block+Treatment,data)
summary(results)
Df Sum Sq Mean Sq F value Pr(>F)
Block 6 1114.3 185.71 8.814 0.00358 **
Treatment 6 1317.4 219.57 10.420 0.00205 **
Residuals 8 168.6 21.07
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
\(H_{0}\): All population means are equal @ no treatments effect
\(H_{1}\): At least one of the population means is different @ there is treatment effects
\(p-value=0.0021\)
Since (\(p-value=0.0021\))\(<\)(\(\alpha=0.05\)), reject \(H_{0}\).
At \(\alpha=0.05\), at least one of the population means is different @ there is treatment effects
library(DescTools)
Registered S3 method overwritten by 'data.table':
method from
print.data.table
ScheffeTest(x=results)
Posthoc multiple comparisons of means: Scheffe Test
95% family-wise confidence level
$Block
diff lwr.ci upr.ci pval
2-1 7.000000e+00 -16.5282445 30.528245 0.9731
3-1 -5.000000e+00 -28.5282445 18.528245 0.9982
4-1 1.800000e+01 -5.5282445 41.528245 0.1801
5-1 4.263256e-14 -23.5282445 23.528245 1.0000
6-1 -3.000000e+00 -26.5282445 20.528245 1.0000
7-1 -1.000000e+00 -24.5282445 22.528245 1.0000
3-2 -1.200000e+01 -35.5282445 11.528245 0.6113
4-2 1.100000e+01 -12.5282445 34.528245 0.7084
5-2 -7.000000e+00 -30.5282445 16.528245 0.9731
6-2 -1.000000e+01 -33.5282445 13.528245 0.8000
7-2 -8.000000e+00 -31.5282445 15.528245 0.9365
4-3 2.300000e+01 -0.5282445 46.528245 0.0565 .
5-3 5.000000e+00 -18.5282445 28.528245 0.9982
6-3 2.000000e+00 -21.5282445 25.528245 1.0000
7-3 4.000000e+00 -19.5282445 27.528245 0.9998
5-4 -1.800000e+01 -41.5282445 5.528245 0.1801
6-4 -2.100000e+01 -44.5282445 2.528245 0.0898 .
7-4 -1.900000e+01 -42.5282445 4.528245 0.1430
6-5 -3.000000e+00 -26.5282445 20.528245 1.0000
7-5 -1.000000e+00 -24.5282445 22.528245 1.0000
7-6 2.000000e+00 -21.5282445 25.528245 1.0000
$Treatment
diff lwr.ci upr.ci pval
4-2 3.000000 -20.528245 26.528245 1.0000
6-2 11.666667 -11.861578 35.194911 0.6438
8-2 18.000000 -5.528245 41.528245 0.1801
10-2 20.333333 -3.194911 43.861578 0.1049
12-2 5.666667 -17.861578 29.194911 0.9946
14-2 9.000000 -14.528245 32.528245 0.8781
6-4 8.666667 -14.861578 32.194911 0.9000
8-4 15.000000 -8.528245 38.528245 0.3491
10-4 17.333333 -6.194911 40.861578 0.2096
12-4 2.666667 -20.861578 26.194911 1.0000
14-4 6.000000 -17.528245 29.528245 0.9915
8-6 6.333333 -17.194911 29.861578 0.9870
10-6 8.666667 -14.861578 32.194911 0.9000
12-6 -6.000000 -29.528245 17.528245 0.9915
14-6 -2.666667 -26.194911 20.861578 1.0000
10-8 2.333333 -21.194911 25.861578 1.0000
12-8 -12.333333 -35.861578 11.194911 0.5790
14-8 -9.000000 -32.528245 14.528245 0.8781
12-10 -14.666667 -38.194911 8.861578 0.3740
14-10 -11.333333 -34.861578 12.194911 0.6763
14-12 3.333333 -20.194911 26.861578 1.0000
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(results)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = Strength ~ Block + Treatment, data = data)
$Block
diff lwr upr p adj
2-1 7.000000e+00 -7.309004 21.309004 0.5452172
3-1 -5.000000e+00 -19.309004 9.309004 0.8200632
4-1 1.800000e+01 3.690996 32.309004 0.0145450
5-1 4.263256e-14 -14.309004 14.309004 1.0000000
6-1 -3.000000e+00 -17.309004 11.309004 0.9782633
7-1 -1.000000e+00 -15.309004 13.309004 0.9999467
3-2 -1.200000e+01 -26.309004 2.309004 0.1115313
4-2 1.100000e+01 -3.309004 25.309004 0.1575900
5-2 -7.000000e+00 -21.309004 7.309004 0.5452172
6-2 -1.000000e+01 -24.309004 4.309004 0.2210906
7-2 -8.000000e+00 -22.309004 6.309004 0.4149066
4-3 2.300000e+01 8.690996 37.309004 0.0032020
5-3 5.000000e+00 -9.309004 19.309004 0.8200632
6-3 2.000000e+00 -12.309004 16.309004 0.9972844
7-3 4.000000e+00 -10.309004 18.309004 0.9217599
5-4 -1.800000e+01 -32.309004 -3.690996 0.0145450
6-4 -2.100000e+01 -35.309004 -6.690996 0.0057301
7-4 -1.900000e+01 -33.309004 -4.690996 0.0105800
6-5 -3.000000e+00 -17.309004 11.309004 0.9782633
7-5 -1.000000e+00 -15.309004 13.309004 0.9999467
7-6 2.000000e+00 -12.309004 16.309004 0.9972844
$Treatment
diff lwr upr p adj
4-2 3.000000 -11.3090041 17.3090041 0.9782633
6-2 11.666667 -2.6423374 25.9756707 0.1252127
8-2 18.000000 3.6909959 32.3090041 0.0145450
10-2 20.333333 6.0243293 34.6423374 0.0070052
12-2 5.666667 -8.6423374 19.9756707 0.7332911
14-2 9.000000 -5.3090041 23.3090041 0.3060975
6-4 8.666667 -5.6423374 22.9756707 0.3397085
8-4 15.000000 0.6909959 29.3090041 0.0394390
10-4 17.333333 3.0243293 31.6423374 0.0180585
12-4 2.666667 -11.6423374 16.9756707 0.9877953
14-4 6.000000 -8.3090041 20.3090041 0.6867666
8-6 6.333333 -7.9756707 20.6423374 0.6393680
10-6 8.666667 -5.6423374 22.9756707 0.3397085
12-6 -6.000000 -20.3090041 8.3090041 0.6867666
14-6 -2.666667 -16.9756707 11.6423374 0.9877953
10-8 2.333333 -11.9756707 16.6423374 0.9938365
12-8 -12.333333 -26.6423374 1.9756707 0.0993180
14-8 -9.000000 -23.3090041 5.3090041 0.3060975
12-10 -14.666667 -28.9756707 -0.3576626 0.0442095
14-10 -11.333333 -25.6423374 2.9756707 0.1405131
14-12 3.333333 -10.9756707 17.6423374 0.9644345
plot(TukeyHSD(results))
The sigficant pair of treatments are : 8-2, 10-2, 8-4, 10-4, 12-10 since p-value is samller than alpha=0.05. The most significant treatment is 10-2.