[R-sig-eco] Using adonis()

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Nov 23 17:51:34 CET 2009


On Mon, 2009-11-23 at 10:33 -0600, Leigh Fall wrote:
> Dear all,
> 
> After performing adonis(), how do you get the distribution of F values to
> decide whether to accept or reject your null hypothesis?  In the help menu,
> I see there is a function 'f.perms', but I have been unsuccessful in using
> it.  I can use the function 'terms' to get information on the components of
> the model.

Why do you want the distribution? The column marked 'Pr(>F)' gives you
the permutation-derived 'p'-value that is, the proportion of the
permuted F's (including the observed) greater than or equal to the
observed F.

> Here is my test:
> 
> > bc <- adonis(bc2 ~samples, perm = 4999, method="jac")
> > bc

We can't run this as we don't have bc2 nor samples. Here is something we
can run (from ?adonis):

> data(dune)
> data(dune.env)
> mod <- adonis(dune ~ Management*A1, data=dune.env, permutations=99)
> mod

Call:
adonis(formula = dune ~ Management * A1, data = dune.env, permutations = 99) 

                    Df SumsOfSqs  MeanSqs  F.Model     R2 Pr(>F)   
Management     3.00000   1.46859  0.48953  3.26288 0.3416   0.01 **
A1             1.00000   0.44089  0.44089  2.93867 0.1026   0.03 * 
Management:A1  3.00000   0.58918  0.19639  1.30902 0.1370   0.26   
Residuals     12.00000   1.80036  0.15003          0.4188          
Total         19.00000   4.29902                   1.0000          
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
> head(mod$f.perms)
          [,1]      [,2]      [,3]
[1,] 0.5435436 0.8537530 0.9314347
[2,] 1.3900990 0.5298171 1.5712973
[3,] 1.4157505 0.5383744 0.7451193
[4,] 1.5889761 0.3698395 0.8468100
[5,] 0.9508102 0.2316184 0.7575177
[6,] 1.0072180 0.6972496 0.7375206
> nrow(mod$f.perms)
[1] 99

Here we have a model with 3 covariates (Management, A1, and their
interaction. Component 'f.perms' is the matrix of F.Model for the 99
permutations (rows) for the 3 covariates (columns). So the permutation F
distribution for Management is in mod$f.perms[,1], e.g.

> hist(mod$f.perms[,1], xlim = range(mod$f.perms[,1], 3.26288))
> abline(v = 3.26288, col = "red")
> box()

Does that help?

G

> 
> Call:
> adonis(formula = bc2 ~ samples, permutations = 4999, method = "jac")
> 
>                         Df      SumsOfSqs  MeanSqs  F.Model       R2
> Pr(>F)
> samples      3.00000    2.06676      0.68892    3.15012    0.1873   2e-04
> ***
> Residuals  41.00000   8.96657       0.21870    0.8127
> Total          44.00000  11.03334                       1.0000
> ---
> Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1   1
> 
> Many thanks for the help in advance!
> 
> Cheers,
> Leigh
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-ecology mailing list