[R] Ask for help on Error() model
Jinsong Zhao
jszhao at yeah.net
Sat Nov 19 12:03:47 CET 2011
Hi there,
I have a experimental design as following:
P A B Y
1 1 1 1 -0.18524045
2 1 1 2 -1.64226232
3 2 2 1 -0.51342697
4 2 2 2 -0.29684874
5 3 3 1 0.71566733
6 3 3 2 -1.06097480
7 4 4 1 0.05772670
8 4 4 2 0.99316677
9 5 1 1 -0.61860414
10 5 1 2 0.50257548
11 6 2 1 -0.33761079
12 6 2 2 0.43147661
13 7 3 1 0.06946383
14 7 3 2 0.85383454
15 8 4 1 0.90484162
16 8 4 2 -0.51943748
17 9 1 1 0.65379758
18 9 1 2 0.08579220
19 10 2 1 -1.71654785
20 10 2 2 -1.35651463
21 11 3 1 0.78819475
22 11 3 2 0.50247178
23 12 4 1 -0.44911823
24 12 4 2 -1.48756811
here, P is the block randomly choose from a large experimental site. A
and B are the two factors. Y is the result of experiment, here just
random number using rnorm(24).
As being told, this experimental design is: A and B are crossed; and
Plot is nested in A and crossed with B.
I try to analyze the data using aov():
aov(Y~A*B + Error(P%in%A), data =df)
it give the following message:
Estimated effects may be unbalanced
Warning message:
In aov(Y ~ A * B + Error(P %in% A), data = df) : Error() model is singular
However, when I using the following code:
aov(Y~A*B + Error(P), data =df)
it gives the same result, but doesn't give the warning.
I hope to know what's the difference between the two formula.
Any suggestions or comments will be really appreciated. Thanks in advance.
Regards,
Jinsong
More information about the R-help
mailing list