[R] contrasts using adonis function

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Jun 16 15:32:00 CEST 2008

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] 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-help mailing list