Randomized Block (Two-way) Analysis of Variance (anova(), factor(), tabs())
Cmd> failures <- vector(8,10,12,13,11, 2,6,7,11,5, 4,10,9,8,10, 3,5,9,10,6, 9,7,5,5,3)
Cmd> reps <- factor(rep(run(5),5))#vector(1,2,3,4,5,1,2,3,4,5,...,)
Cmd> treatment<-factor(rep(run(5),rep(5,5)))#vector(1,1,1,1,1,2,..)
Cmd> hconcat(reps, treatment, failures) # see them all
(1,1) 1 1 8
(2,1) 2 1 10
(3,1) 3 1 12
(4,1) 4 1 13
(5,1) 5 1 11
(6,1) 1 2 2
(7,1) 2 2 6
(8,1) 3 2 7
(9,1) 4 2 11
(10,1) 5 2 5
(11,1) 1 3 4
(12,1) 2 3 10
(13,1) 3 3 9
(14,1) 4 3 8
(15,1) 5 3 10
(16,1) 1 4 3
(17,1) 2 4 5
(18,1) 3 4 9
(19,1) 4 4 10
(20,1) 5 4 6
(21,1) 1 5 9
(22,1) 2 5 7
(23,1) 3 5 5
(24,1) 4 5 5
(25,1) 5 5 3
Cmd> tabs(failures,treatment,mean:T,count:T) # treatment means component: mean
component: mean
(1) 10.8 6.2 8.2 6.6 5.8
component: count
(1) 5 5 5 5 5
Cmd> tabs(failures, reps, mean:T,count:T) # block means component: mean
component: mean
(1) 5.2 7.6 8.4 9.4 7
component: count
(1) 5 5 5 5 5
Cmd> anova("failures = reps + treatment",fstat:T) # do ANOVA Model used is failures = reps + treatment
Model used is failures = reps + treatment
DF SS MS F P-value
CONSTANT 1 1413.8 1413.8 261.32348 p<1e-08
treatment 4 83.84 20.96 3.87431 0.021886
ERROR1 16 86.56 5.41
出力画面どおりの画面配置ではない。もとの画面は見やすいし、必要充分で使いやすいと思う。
References
An Introduction to MacAnova
pp.62