[R-sig-eco] stratifying variables in Adonis
Duncan Mackay
duncan.mackay at flinders.edu.au
Wed Mar 16 12:40:28 CET 2011
Hello all,
In the documentation for Adonis in the vegan package, there is an example of a replicated random block design with Nitrate levels as a treatment factor and field as a blocking factor.
The following model is shown :-
### Correct hypothesis test (with strata)
adonis(Y ~ NO3, data=dat, strata=dat$field, perm=1e3)
which results in the following output:-
Call:
adonis(formula = Y ~ NO3, data = dat, permutations = 1000, strata = dat$field)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
NO3 1 0.018446 0.018446 1.1241 0.10105 0.03397 *
Residuals 10 0.164090 0.016409 0.89895
Total 11 0.182536 1.00000
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
If we remove the replication by selecting only the first replicate in each block,
> dat1 <- dat[dat$rep==1,]
we get
> dat1
rep NO3 field
1 1 0 1
3 1 10 1
5 1 0 2
7 1 10 2
9 1 0 3
11 1 10 3
And
> Y1 <-Y[dat$rep==1,]
> Y1
Agropyron Schizachyrium
1 3.361260 0.9419159
3 5.579260 1.5222111
5 5.194289 2.7812308
7 6.210538 2.6668505
9 5.916120 4.1912890
11 7.575184 2.1243425
And if we analyze this
> adonis(Y1 ~ NO3,strata=dat1$field, data=dat1,perm=1000)
Call:
adonis(formula = Y1 ~ NO3, data = dat1, permutations = 1000, strata = dat1$field)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
NO3 1 0.022964 0.022964 0.88214 0.18069 0.2418
Residuals 4 0.104128 0.026032 0.81931
Total 5 0.127091 1.00000
My first question is:- Is it OK to add the stratifying variable (field) in the model statement as below.
> adonis(Y1 ~ NO3 + field,strata=dat1$field, data=dat1,perm=1000)
Call:
adonis(formula = Y1 ~ NO3 + field, data = dat1, permutations = 1000, strata = dat1$field)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
NO3 1 0.022964 0.022964 1.6959 0.18069 0.2358
field 2 0.077045 0.038523 2.8449 0.60622 0.2358
Residuals 2 0.027082 0.013541 0.21309
Total 5 0.127091 1.00000
However, my second question is :- How has Adonis has come up with a P-value here for field? I thought that all shuffling of data was occurring within fields and therefore that the field totals (and F-ratios) would be the same for each permutation?
Thanks for any help,
Duncan
______________________________________________________________________________
Dr. Duncan Mackay
School of Biological Sciences
Flinders University
GPO Box 2100
Adelaide
S.A. 5001
AUSTRALIA
Phone 61-8-82012627
FAX 61-8-82013015
http://www.flinders.edu.au/science_engineering/biology/our-school/staff-postgrads/academic-staff/mackay-duncan.cfm
More information about the R-sig-ecology
mailing list