[R] Blocking and Nested ANOVA Design. Am I using the aov() function correctly?

Eleftheria Dalmaris edalmaris at gmail.com
Fri Apr 16 16:44:54 CEST 2010


Dear list members,

I am new member and fairly new into R world! I hope what I have is not
beyond the purpose of this list. I did first search for similar
experimental designs without success.

I want to perform an ANOVA analysis using the aov() function. I am not
100% sure that I have it right. If anyone can help me, that will be
greatly appreciated. My design is not balanced for any of the factors.

My main aim is to compare the 5 different AI (aridity index) groups
and to identify a pattern of the response of the AI groups to the
treatment that I applied for the parameter that I measured. In total I
have 24 different populations of a specific tree species. The
population refers to the geographical area that I choose to collect
seeds from and for every population I know the annual rainfall and
annual evapotranspiration. I started with equal replicate number of
plants per population per treatment, but some died and some where not
healthy enough to include them in the experiment.

My design is as follows:

-      Blocks (6 blocks, those are different days that I planted my
plants. Every block at the beginning had at least one plant for every
population for every treatment. At the end some died or where not
healthy enough and that's why I have an unbalanced design.).
-      Treatments (2 treatments that I selected therefore fixed)
-      AI  (5 AI, this is and Aridity Index, is the ratio of rainfall
to evapotranspiration for each of my populations and therefore each
population goes to the appropriate AI group. When I selected my
populations I did not select them in order to have a balance design
from the AI perspective).
-      Populations nested in AI

and I am interested for the interactions as well.

So if OP is one of my parameters that I measured I right the following
function and when I run it I get the ANOVA table that I show:


b<- aov(OP ~ Block + Treat*factor(AI)*(factor(AI)/factor(Pop)))
summary (b)
                                                    Df        Sum Sq
Mean Sq     F value  Pr(>F)
Block                                              5      2.187
0.437       2.6350     0.02423 *
Treat                                               1   126.656
126.656    762.8590    < 2e-16 ***
factor(AI)                                         4       2.098
0.525        3.1598    0.01478 *
Treat:factor(AI)                                4        1.057
0.264      1.5912     0.17721
factor(AI):factor(Pop)                      19        2.990
0.157      0.9478     0.52430
Treat:factor(AI):factor(Pop)              19        2.811       0.148
    0.8912     0.59429
Residuals                                     245      40.677
0.166

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



If this is right I need to correct the F value. Since Pop is nested
within AI I need to use different f ratios. And the rations that I am
using are the ones that I show in the following table. For simplicity
I am using the number from 1 to 7 and not MS.


       Source of variation      df           F-ratio
1           Block                   5             1/7
2           Treat                    1             2/5
3             AI                      4             3/5
4         Treat<AI                 4             4/5
5           AI<Pop               19            5/7
6       Treat<AI<Pop          19            6/5
7         Residuals             254


Have I used the aov() function correctly? Can anyone comment on that?



That’s the first thing that I need to confirm.

The other thing is:

If I exclude the factor(AI) that is outside of the parenthesis, I get
the following:


b1<- aov(OP ~ Block + Treat*(factor(AI)/factor(Pop)))
> summary (b1)

                                                   Df    Sum Sq  Mean
Sq    F value     Pr(>F)
Block                                           5      2.187
0.437       2.6350      0.02423 *
Treat                                            1   126.656   126.656
   762.8590      < 2e-16 ***
factor(AI)                                      4       2.098
0.525        3.1598      0.01478 *
factor(AI):factor(Pop)                    19      3.056      0.161
    0.9689      0.49862
Treat:factor(AI)                              4      0.990      0.248
       1.4909      0.20551
Treat:factor(AI):factor(Pop)            19      2.811      0.148
 0.8912      0.59429
Residuals                                  245     40.677     0.166

---

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


The differences between the two tables are not significant at all, but
I’m guessing that the one is more correct then the other one. Which
one is preferable?

I continue with using TukeyHSD, but I’m not going to get into that now.

Not sure if the raw data are necessary but I have attached them.

Thanking you in advance,

Eleftheria
-------------- next part --------------
Pop	AI	Block	Treat	OP
2	0.2	A	C	1.13
22	0.2	A	C	2.31
3	0.2	A	C	1.56
6	0.2	A	C	1.80
7	0.3	A	C	1.56
11	0.3	A	C	1.87
19	0.3	A	C	1.37
13	0.3	A	C	1.82
27	0.3	A	C	1.57
1	0.4	A	C	1.80
15	0.4	A	C	1.23
24	0.4	A	C	1.08
16	0.4	A	C	1.68
4	0.4	A	C	1.86
25	0.4	A	C	2.30
17	0.5	A	C	2.04
12	0.5	A	C	1.45
9	0.5	A	C	2.00
28	0.5	A	C	2.14
21	0.6	A	C	2.18
18	0.6	A	C	1.91
10	0.6	A	C	1.40
2	0.2	B	C	2.11
22	0.2	B	C	2.43
3	0.2	B	C	1.65
6	0.2	B	C	1.39
7	0.3	B	C	1.89
11	0.3	B	C	1.64
19	0.3	B	C	1.30
13	0.3	B	C	1.19
27	0.3	B	C	2.24
20	0.3	B	C	1.65
1	0.4	B	C	2.01
15	0.4	B	C	2.03
24	0.4	B	C	2.02
4	0.4	B	C	1.81
17	0.5	B	C	2.03
12	0.5	B	C	2.38
9	0.5	B	C	2.61
28	0.5	B	C	1.45
21	0.6	B	C	1.65
18	0.6	B	C	2.16
10	0.6	B	C	2.00
22	0.2	C	C	1.94
3	0.2	C	C	2.08
6	0.2	C	C	1.37
7	0.3	C	C	1.43
11	0.3	C	C	1.82
13	0.3	C	C	1.65
27	0.3	C	C	2.20
20	0.3	C	C	1.65
1	0.4	C	C	2.83
15	0.4	C	C	1.91
24	0.4	C	C	2.37
16	0.4	C	C	1.79
4	0.4	C	C	1.50
25	0.4	C	C	1.09
17	0.5	C	C	2.05
12	0.5	C	C	1.16
9	0.5	C	C	1.72
10	0.6	C	C	2.67
2	0.2	D	C	1.59
22	0.2	D	C	1.83
3	0.2	D	C	2.05
6	0.2	D	C	1.27
7	0.3	D	C	1.58
26	0.3	D	C	1.57
11	0.3	D	C	1.14
20	0.3	D	C	1.63
1	0.4	D	C	1.69
15	0.4	D	C	1.78
24	0.4	D	C	1.74
16	0.4	D	C	1.25
4	0.4	D	C	1.70
17	0.5	D	C	1.49
12	0.5	D	C	1.56
9	0.5	D	C	1.05
28	0.5	D	C	1.63
21	0.6	D	C	1.54
18	0.6	D	C	1.98
10	0.6	D	C	1.85
2	0.2	E	C	2.04
22	0.2	E	C	1.76
3	0.2	E	C	1.94
6	0.2	E	C	1.23
7	0.3	E	C	1.64
26	0.3	E	C	1.65
11	0.3	E	C	1.52
19	0.3	E	C	1.37
13	0.3	E	C	1.81
27	0.3	E	C	2.00
20	0.3	E	C	1.89
1	0.4	E	C	1.60
24	0.4	E	C	1.20
16	0.4	E	C	2.07
25	0.4	E	C	1.26
17	0.5	E	C	1.98
12	0.5	E	C	1.93
9	0.5	E	C	1.44
21	0.6	E	C	2.18
18	0.6	E	C	1.88
10	0.6	E	C	2.50
2	0.2	F	C	1.71
22	0.2	F	C	2.17
3	0.2	F	C	1.94
6	0.2	F	C	1.39
7	0.3	F	C	2.22
19	0.3	F	C	1.89
13	0.3	F	C	1.67
27	0.3	F	C	2.63
20	0.3	F	C	2.24
1	0.4	F	C	2.11
15	0.4	F	C	1.84
16	0.4	F	C	2.02
4	0.4	F	C	1.99
25	0.4	F	C	2.16
17	0.5	F	C	2.22
12	0.5	F	C	1.83
9	0.5	F	C	2.22
28	0.5	F	C	2.24
21	0.6	F	C	1.53
18	0.6	F	C	1.94
10	0.6	F	C	2.22
22	0.2	E	C	2.02
3	0.2	E	C	2.48
7	0.3	E	C	1.61
11	0.3	E	C	1.29
19	0.3	E	C	1.57
13	0.3	E	C	1.72
16	0.4	E	C	1.52
17	0.5	E	C	1.73
9	0.5	E	C	1.98
18	0.6	E	C	2.20
22	0.2	F	C	2.42
7	0.3	F	C	2.15
26	0.3	F	C	1.18
27	0.3	F	C	1.57
24	0.4	F	C	1.62
17	0.5	F	C	2.50
21	0.6	F	C	1.58
2	0.2	A	S	2.01
22	0.2	A	S	3.71
3	0.2	A	S	3.22
6	0.2	A	S	3.54
7	0.3	A	S	3.23
26	0.3	A	S	4.53
11	0.3	A	S	3.24
19	0.3	A	S	2.95
13	0.3	A	S	3.10
27	0.3	A	S	3.21
20	0.3	A	S	3.11
1	0.4	A	S	2.94
15	0.4	A	S	3.20
24	0.4	A	S	3.25
16	0.4	A	S	2.84
4	0.4	A	S	3.66
25	0.4	A	S	2.50
17	0.5	A	S	2.94
12	0.5	A	S	3.36
21	0.6	A	S	2.84
18	0.6	A	S	3.14
10	0.6	A	S	3.44
2	0.2	B	S	4.77
22	0.2	B	S	3.26
3	0.2	B	S	3.75
6	0.2	B	S	1.99
7	0.3	B	S	4.07
26	0.3	B	S	2.69
11	0.3	B	S	3.26
19	0.3	B	S	3.22
13	0.3	B	S	2.73
27	0.3	B	S	2.55
20	0.3	B	S	3.17
1	0.4	B	S	2.60
15	0.4	B	S	2.99
24	0.4	B	S	2.75
16	0.4	B	S	3.01
25	0.4	B	S	3.71
17	0.5	B	S	3.25
12	0.5	B	S	3.23
9	0.5	B	S	2.85
28	0.5	B	S	3.20
21	0.6	B	S	3.41
18	0.6	B	S	3.96
10	0.6	B	S	2.49
2	0.2	C	S	2.94
22	0.2	C	S	3.14
3	0.2	C	S	2.79
6	0.2	C	S	3.58
7	0.3	C	S	2.67
11	0.3	C	S	3.32
19	0.3	C	S	3.27
13	0.3	C	S	3.23
27	0.3	C	S	3.50
20	0.3	C	S	3.13
1	0.4	C	S	2.76
15	0.4	C	S	3.07
24	0.4	C	S	3.26
16	0.4	C	S	3.07
4	0.4	C	S	3.59
25	0.4	C	S	2.81
17	0.5	C	S	2.97
12	0.5	C	S	2.58
9	0.5	C	S	2.98
21	0.6	C	S	4.38
18	0.6	C	S	3.29
10	0.6	C	S	2.81
2	0.2	D	S	2.30
22	0.2	D	S	2.84
3	0.2	D	S	2.74
6	0.2	D	S	3.43
7	0.3	D	S	3.87
26	0.3	D	S	3.57
11	0.3	D	S	2.80
19	0.3	D	S	3.19
27	0.3	D	S	3.35
20	0.3	D	S	3.24
1	0.4	D	S	2.95
15	0.4	D	S	2.68
24	0.4	D	S	2.71
16	0.4	D	S	3.05
4	0.4	D	S	3.12
25	0.4	D	S	3.58
17	0.5	D	S	3.34
12	0.5	D	S	2.55
9	0.5	D	S	2.81
28	0.5	D	S	2.84
21	0.6	D	S	3.38
18	0.6	D	S	3.62
10	0.6	D	S	3.56
2	0.2	E	S	2.47
22	0.2	E	S	3.63
3	0.2	E	S	2.95
6	0.2	E	S	3.47
7	0.3	E	S	2.62
26	0.3	E	S	3.27
11	0.3	E	S	3.25
19	0.3	E	S	2.60
13	0.3	E	S	2.94
27	0.3	E	S	2.86
20	0.3	E	S	2.95
1	0.4	E	S	3.56
15	0.4	E	S	2.68
24	0.4	E	S	3.35
16	0.4	E	S	3.06
4	0.4	E	S	2.63
25	0.4	E	S	3.26
17	0.5	E	S	2.89
12	0.5	E	S	3.17
9	0.5	E	S	2.58
28	0.5	E	S	3.48
21	0.6	E	S	3.54
18	0.6	E	S	3.13
10	0.6	E	S	4.16
2	0.2	F	S	2.53
22	0.2	F	S	2.79
3	0.2	F	S	3.14
6	0.2	F	S	3.02
7	0.3	F	S	3.39
26	0.3	F	S	3.07
11	0.3	F	S	2.74
13	0.3	F	S	3.19
27	0.3	F	S	3.12
20	0.3	F	S	3.97
1	0.4	F	S	3.24
16	0.4	F	S	3.10
4	0.4	F	S	3.30
25	0.4	F	S	3.05
12	0.5	F	S	3.81
9	0.5	F	S	3.43
28	0.5	F	S	3.05
21	0.6	F	S	2.92
18	0.6	F	S	3.42
10	0.6	F	S	3.41
22	0.2	E	S	2.98
3	0.2	E	S	2.80
19	0.3	E	S	2.89
13	0.3	E	S	2.24
1	0.4	E	S	2.86
24	0.4	E	S	2.41
25	0.4	E	S	2.39
12	0.5	E	S	3.13
18	0.6	E	S	2.99
2	0.2	F	S	3.26
22	0.2	F	S	2.74
3	0.2	F	S	2.77
6	0.2	F	S	2.02
7	0.3	F	S	3.05
19	0.3	F	S	3.67
13	0.3	F	S	3.19
20	0.3	F	S	3.61
1	0.4	F	S	2.77
4	0.4	F	S	2.46
25	0.4	F	S	3.74
12	0.5	F	S	3.59
9	0.5	F	S	2.85
28	0.5	F	S	2.88
18	0.6	F	S	3.55


More information about the R-help mailing list