Examples for 'stats::eff.aovlist'


Compute Efficiencies of Multistratum Analysis of Variance

Aliases: eff.aovlist

Keywords: models

### ** Examples

## An example from Yates (1932),
## a 2^3 design in 2 blocks replicated 4 times

Block <- gl(8, 4)
A <- factor(c(0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
              0,1,0,1,0,1,0,1,0,1,0,1))
B <- factor(c(0,0,1,1,0,0,1,1,0,1,0,1,1,0,1,0,0,0,1,1,
              0,0,1,1,0,0,1,1,0,0,1,1))
C <- factor(c(0,1,1,0,1,0,0,1,0,0,1,1,0,0,1,1,0,1,0,1,
              1,0,1,0,0,0,1,1,1,1,0,0))
Yield <- c(101, 373, 398, 291, 312, 106, 265, 450, 106, 306, 324, 449,
           272, 89, 407, 338, 87, 324, 279, 471, 323, 128, 423, 334,
           131, 103, 445, 437, 324, 361, 302, 272)
aovdat <- data.frame(Block, A, B, C, Yield)

old <- getOption("contrasts")
options(contrasts = c("contr.helmert", "contr.poly"))
## IGNORE_RDIFF_BEGIN
(fit <- aov(Yield ~ A*B*C + Error(Block), data = aovdat))
Call:
aov(formula = Yield ~ A * B * C + Error(Block), data = aovdat)

Grand Mean: 291.5938

Stratum 1: Block

Terms:
                      A:B       A:C       B:C     A:B:C Residuals
Sum of Squares   780.1250  276.1250 2556.1250  112.5000  774.0938
Deg. of Freedom         1         1         1         1         3

Residual standard error: 16.06335
Estimated effects are balanced

Stratum 2: Within

Terms:
                        A         B         C       A:B       A:C       B:C
Sum of Squares    3465.28 161170.03 278817.78     28.17   1802.67  11528.17
Deg. of Freedom         1         1         1         1         1         1
                    A:B:C Residuals
Sum of Squares      45.37   5423.28
Deg. of Freedom         1        17

Residual standard error: 17.86103
Estimated effects are balanced
## IGNORE_RDIFF_END
eff.aovlist(fit)
       A B C  A:B  A:C  B:C A:B:C
Block  0 0 0 0.25 0.25 0.25  0.25
Within 1 1 1 0.75 0.75 0.75  0.75
options(contrasts = old)

[Package stats version 4.2.3 Index]