Re: [R] contrasts using adonis function

From: Gavin Simpson <>
Date: Mon, 16 Jun 2008 14:32:00 +0100

On Mon, 2008-06-16 at 14:38 +0200, Luis San José García wrote:
> Hi,
> Somebody knows how to make contrasts if i'm using the function adonis?

What is wrong with the defaults? From ?adonis:


     adonis(formula, data, permutations = 5, method = "bray",
            strata = NULL, contr.unordered = "contr.sum",
            contr.ordered = "contr.poly", ...)

So look at ?contr.sum and ?contr.poly for what constrasts adonis uses by default. If you want something different, then supply "contr.helmert" or "contr.treatment", "contr.sum", or "contr.poly" to the relevant argument in your adonis call.

If you want your own "special" contrasts, then I presume they make sense in the context of the analysis? But for that you'll need to write your own function to calculate the constrasts you want, along the lines of contr.sum() or one of the other contrast functions.


 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e]
 Gower Street, London          [w]
 UK. WC1E 6BT.                 [w]

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 16 Jun 2008 - 13:52:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 16 Jun 2008 - 14:30:51 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive