[R] Nested design with aov

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Mar 4 13:50:17 CET 2000

```> Date: Sat, 04 Mar 2000 12:19:46 +0000
> From: Marcelo Martinez Palao <marmp at fcu.um.es>
>
>
> I want to do this model:
>
> Y_ml=Mu+M+L(M)+Error
>
> M is a fixed factor with two levels, 1 and 2
> L is a random factor and nested in M, with 9 levels (9 places inside
> each level of M)

L and M appear to be sets of numbers, not R factors, and you have not
declared L to be random.

> M <- factor(rep(1:2, rep(27, 2)))
> L <- factor(rep(1:18, rep(3, 18)))
> summary(aov(amarc ~ M + M/L))
Df  Sum Sq Mean Sq F value    Pr(>F)
M            1 130.667 130.667 35.2800 8.366e-07
M:L         16 313.259  19.579  5.2863 1.682e-05
Residuals   36 133.333   3.704

If you really want L to be random, you will need to used a Error term.

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```