Running examples in ‘easyanova-Ex.R’ failed
The error most likely occurred in:

> ### Name: ea1
> ### Title: Analysis of variance in simple designs
> ### Aliases: ea1
> 
> ### ** Examples
> 
> 
> # Kaps and Lamberson(2009)
> data(data1)
> data(data2)
> data(data3)
> data(data4)
> 
> # analysis in completely randomized design
> r1<-ea1(data1, design=1)
> 
> names(r1)
[1] "Analysis of variance"     "Means"                   
[3] "Multiple comparison test" "Residual analysis"       
> 
> r1
$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  2      3640   1820.0000  6.1348 0.0146
Residuals  12      3560    296.6667       -      -

$Means
  treatment mean standard.error tukey snk duncan t scott_knott
1        d3  312         7.7028     a   a      a a           a
2        d1  280         7.7028     b   b      b b           b
3        d2  278         7.7028     b   b      b b           b

$`Multiple comparison test`
     pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 d3 - d1       32   0.0310 0.0124    0.0124 0.0124
2 d3 - d2       34   0.0223 0.0223    0.0112 0.0088
3 d1 - d2        2   0.9816 0.8574    0.8574 0.8574

$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.8937
p.value Bartlett test         0.5662
coefficient of variation (%)  5.9400
first value most discrepant   7.0000
second value most discrepant 12.0000
third value most discrepant  11.0000

> 
> # analysis in randomized block design
> r2<-ea1(data2, design=2)
> 
> # analysis in latin square design
> r3<-ea1(data3, design=3)
> 
> # analysis in several latin squares design
> r4<-ea1(data4, design=4)
> 
> r1[1]
$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  2      3640   1820.0000  6.1348 0.0146
Residuals  12      3560    296.6667       -      -

> r2[1]
$`Analysis of variance`
           df type III SS mean square F value    p>F
treatments  2        6536        3268  5.3399 0.0465
blocks      3       18198        6066  9.9118 0.0097
Residuals   6        3672         612       -      -

> r3[1]
$`Analysis of variance`
           df type III SS mean square F value    p>F
treatments  3     12.0219      4.0073 27.6763 <0.001
rows        3      1.4819      0.4940  3.4115 0.0938
columns     3      3.5919      1.1973  8.2691 0.0149
Residuals   6      0.8688      0.1448       -      -

> r4[1]
$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  3   22.8934      7.6311 38.7737 <0.001
squares     1    1.0878      1.0878  5.5272 0.0328
rows        6    5.4819      0.9136  4.6422 0.0074
columns     6    2.0569      0.3428  1.7418 0.1793
Residuals  15    2.9522      0.1968       -      -

> 
> # analysis in unbalanced randomized block design
> response<-ifelse(data2$Gain>850, NA, data2$Gain)
> ndata<-data.frame(data2[-3],response)
> ndata
   Treatments Blocks response
1          t1     b1      826
2          t1     b2       NA
3          t1     b3      795
4          t1     b4      850
5          t2     b1      827
6          t2     b2       NA
7          t2     b3      721
8          t2     b4       NA
9          t3     b1      753
10         t3     b2      804
11         t3     b3      737
12         t3     b4      822
> 
> r5<-ea1(ndata, design=2 )
> 
> r5
$`Analysis of variance`
           df type III SS mean square F value    p>F
treatments  2    4232.250    2116.125  2.2723 0.2507
blocks      3    9258.917    3086.306  3.3142 0.1757
Residuals   3    2793.750     931.250       -      -

$`Adjusted means`
  treatment adjusted.mean standard.error tukey snk duncan t scott_knott
1        t1        832.00        19.6982     a   a      a a           a
2        t2        801.75        24.9165     a   a      a a           a
3        t3        779.00        15.2582     a   a      a a           a

$`Multiple comparison test`
     pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 t1 - t2    30.25   0.6501 0.4112    0.4112 0.4112
2 t1 - t3    53.00   0.2313 0.2313    0.1233 0.1233
3 t2 - t3    22.75   0.7399 0.4930    0.4930 0.4930

$`Residual analysis`
                             values
p.value Shapiro-Wilk test    0.7750
p.value Bartlett test        0.5502
coefficient of variation (%) 3.8500
first value most discrepant  5.0000
second value most discrepant 7.0000
third value most discrepant  9.0000

> 
> # multivariable response (list argument = TRUE)
> t<-c('a','a','a','b','b','b','c','c','c')
> r1<-c(10,12,12.8,4,6,8,14,15,16)
> r2<-c(102,105,106,125,123,124,99,95,96)
> r3<-c(560,589,590,658,678,629,369,389,378)
> 
> 
> d<-data.frame(t,r1,r2,r3)
> 
> results=ea1(d, design=1, list=TRUE)
> names(results)
[1] "r1" "r2" "r3"
> results
$r1
$r1$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  2    123.92       61.96 26.2542 0.0011
Residuals   6     14.16        2.36       -      -

$r1$Means
  treatment mean standard.error tukey snk duncan t scott_knott
1         c 15.0         0.8869     a   a      a a           a
2         a 11.6         0.8869     a   b      b b           b
3         b  6.0         0.8869     b   c      c c           c

$r1$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 c - a      3.4   0.0781 0.0351    0.0351 0.0351
2 c - b      9.0   0.0009 0.0009    0.0005 0.0004
3 a - b      5.6   0.0101 0.0043    0.0043 0.0043

$r1$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.8513
p.value Bartlett test         0.6879
coefficient of variation (%) 14.1400
first value most discrepant   6.0000
second value most discrepant  4.0000
third value most discrepant   1.0000


$r2
$r2$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  2 1192.6667    596.3333 185.069 <0.001
Residuals   6   19.3333      3.2222       -      -

$r2$Means
  treatment     mean standard.error tukey snk duncan t scott_knott
1         b 124.0000         1.0364     a   a      a a           a
2         a 104.3333         1.0364     b   b      b b           b
3         c  96.6667         1.0364     c   c      c c           c

$r2$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)  p(t)
1 b - a  19.6667   0.0000  0.000     0.000 0.000
2 b - c  27.3333   0.0000  0.000     0.000 0.000
3 a - c   7.6666   0.0047  0.002     0.002 0.002

$r2$`Residual analysis`
                             values
p.value Shapiro-Wilk test    0.9605
p.value Bartlett test        0.6234
coefficient of variation (%) 1.6600
first value most discrepant  7.0000
second value most discrepant 1.0000
third value most discrepant  8.0000


$r3
$r3$`Analysis of variance`
           df  type I SS mean square  F value    p>F
treatments  2 122436.222  61218.1111 184.0839 <0.001
Residuals   6   1995.333    332.5556        -      -

$r3$Means
  treatment     mean standard.error tukey snk duncan t scott_knott
1         b 655.0000        10.5286     a   a      a a           a
2         a 579.6667        10.5286     b   b      b b           b
3         c 378.6667        10.5286     c   c      c c           c

$r3$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 b - a  75.3333   0.0055 0.0023    0.0023 0.0023
2 b - c 276.3333   0.0000 0.0000    0.0000 0.0000
3 a - c 201.0000   0.0000 0.0000    0.0000 0.0000

$r3$`Residual analysis`
                             values
p.value Shapiro-Wilk test    0.6658
p.value Bartlett test        0.5492
coefficient of variation (%) 3.3900
first value most discrepant  6.0000
second value most discrepant 5.0000
third value most discrepant  1.0000


> 
> results[1][[1]]
$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  2    123.92       61.96 26.2542 0.0011
Residuals   6     14.16        2.36       -      -

$Means
  treatment mean standard.error tukey snk duncan t scott_knott
1         c 15.0         0.8869     a   a      a a           a
2         a 11.6         0.8869     a   b      b b           b
3         b  6.0         0.8869     b   c      c c           c

$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 c - a      3.4   0.0781 0.0351    0.0351 0.0351
2 c - b      9.0   0.0009 0.0009    0.0005 0.0004
3 a - b      5.6   0.0101 0.0043    0.0043 0.0043

$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.8513
p.value Bartlett test         0.6879
coefficient of variation (%) 14.1400
first value most discrepant   6.0000
second value most discrepant  4.0000
third value most discrepant   1.0000

> 
> names(results[1][[1]])
[1] "Analysis of variance"     "Means"                   
[3] "Multiple comparison test" "Residual analysis"       
> 
> # analysis with a covariate
> # Kaps and Lamberson (2009)
> data(data10)
> 
> # analysis in completely randomized design
> r6<-ea1(data10[-3], design=5)
> 
> r6
$`Analysis of variance`
           df type I SS mean square F value    p>F
covariate   1  4441.253   4441.2526 46.9153 <0.001
treatments  2  1050.762    525.3810  5.5499 0.0216
Residuals  11  1041.319     94.6653       -      -

$`Adjusted means`
  treatment adjusted.mean standard.error tukey snk duncan t scott_knott
1         A      988.8645         4.3512     a   a      a a           a
2         C      973.6117         4.3512    ab   b      b b           b
3         B      967.5238         4.3512     b   b      b b           b

$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 A - C  15.2528   0.0728 0.0306    0.0306 0.0306
2 A - B  21.3407   0.0134 0.0134    0.0067 0.0053
3 C - B   6.0879   0.5983 0.3438    0.3438 0.3438

$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.9014
p.value Bartlett test         0.1274
coefficient of variation (%)  1.0000
first value most discrepant  14.0000
second value most discrepant 13.0000
third value most discrepant   6.0000

> 
> 
> # incomplete blocks type I and II
> # Pimentel Gomes and Garcia (2002)
> data(data11)
> data(data12)
> 
> #r7<-ea1(data11,design=7)
> #r8<-ea1(data12,design=7)
> 
> #r7;r8
> 
> 
> # incomplete blocks type III or augmented blocks 
> # Cruz and Carneiro (2006)
> data(data13)
> 
> #r9<-ea1(data13, design=8)
> #r9
> 
> 
> 
> # incomplete blocks type III in animal experiments
> # Sampaio (2010)
> data(data14)
> 
> r10<-ea1(data14, design=9)
> r10
$`Analysis of variance`
           df type I SS mean square F value    p>F
treatments  6  362.5393     60.4232 23.7297 <0.001
subject     6  124.1421     20.6904  8.1256 0.0011
period      3  102.4096     34.1365 13.4063 <0.001
Residuals  12   30.5557      2.5463       -      -

$`Adjusted means`
  treatment adjusted.mean standard.error tukey snk duncan t scott_knott
1         A       66.9250         0.8453     a   a      a a           a
2         C       60.7750         0.8453     b   b      b b           b
3         B       59.5607         0.8453    bc   b      b b           b
4         E       58.6893         0.8453    bc  bc      b b           b
5         F       58.6536         0.8453    bc   b      b b           b
6         D       55.7250         0.8453    cd   c      c c           c
7         G       52.5964         0.8453     d   d      d d           d

$`Multiple comparison test`
    pair contrast p(tukey) p(snk) p(duncan)   p(t)
1  A - C   6.1500   0.0034 0.0002    0.0002 0.0002
2  A - B   7.3643   0.0007 0.0001    0.0001 0.0000
3  A - E   8.2357   0.0002 0.0001    0.0000 0.0000
4  A - F   8.2714   0.0002 0.0001    0.0000 0.0000
5  A - D  11.2000   0.0000 0.0000    0.0000 0.0000
6  A - G  14.3286   0.0000 0.0000    0.0000 0.0000
7  C - B   1.2143   0.9405 0.3298    0.3298 0.3298
8  C - E   2.0857   0.6028 0.2294    0.1221 0.1066
9  C - F   2.1214   0.5857 0.3310    0.1254 0.1013
10 C - D   5.0500   0.0150 0.0085    0.0021 0.0012
11 C - G   8.1786   0.0003 0.0002    0.0000 0.0000
12 B - E   0.8714   0.9877 0.4800    0.4800 0.4800
13 B - F   0.9071   0.9850 0.7342    0.4845 0.4626
14 B - D   3.8357   0.0806 0.0330    0.0111 0.0075
15 B - G   6.9643   0.0012 0.0006    0.0002 0.0001
16 E - F   0.0357   1.0000 0.9767    0.9767 0.9767
17 E - D   2.9643   0.2475 0.0694    0.0353 0.0290
18 E - G   6.0929   0.0036 0.0013    0.0004 0.0003
19 F - D   2.9286   0.2582 0.0306    0.0306 0.0306
20 F - G   6.0572   0.0038 0.0007    0.0004 0.0003
21 D - G   3.1286   0.2028 0.0225    0.0225 0.0225

$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.0575
p.value Bartlett test         0.2299
coefficient of variation (%)  2.7100
first value most discrepant  14.0000
second value most discrepant 20.0000
third value most discrepant  17.0000

> 
> # lattice 
> # Pimentel Gomes and Garcia (2002)
> data(data15)
> 
> #r11<-ea1(data15, design=10) # intra-block analysis 
> #r12<-ea1(data15, design=11) # inter-block analysis
> 
> #r11
> #r12
> 
> # switchback design
> # Sampaio (2010)
> data(data16)
> r13<-ea1(data16, design=12)
> r13
$`Analysis of variance`
           df type I SS mean square  F value    p>F
animal     11  202.5100     18.4100 130.0379 <0.001
period      2   71.4867     35.7433 252.4709 <0.001
treatments  2    5.0808      2.5404  17.9441 <0.001
p:animal   11    7.3183      0.6653   4.6993 0.0139
Residuals   9    1.2742      0.1416        -      -

$`Adjusted means`
  treatment adjusted.mean standard.error tukey snk duncan t scott_knott
1         A        8.8625          0.133     a   a      a a           a
2         C        8.5250          0.133     a   a      a a           a
3         B        7.7625          0.133     b   b      b b           b

$`Multiple comparison test`
   pair contrast p(tukey) p(snk) p(duncan)   p(t)
1 A - C   0.3375   0.2256 0.1063    0.1063 0.1063
2 A - B   1.1000   0.0006 0.0006    0.0003 0.0002
3 C - B   0.7625   0.0073 0.0029    0.0029 0.0029

$`Residual analysis`
                              values
p.value Shapiro-Wilk test     0.8478
p.value Bartlett test         0.2402
coefficient of variation (%)  4.4900
first value most discrepant   2.0000
second value most discrepant  8.0000
third value most discrepant  35.0000

> 
> # switchback design in blocks
> # Sanders and Gaynor (1987)
> data(data17)
> r14<-ea1(data17, design=13)
Error in if (sum(x) == 0) { : missing value where TRUE/FALSE needed
Calls: ea1 -> lapply -> FUN -> ft -> inab
Execution halted