[R] Mantel test!

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Oct 13 14:31:09 CEST 2006


On Fri, 2006-10-13 at 14:07 +0200, Hossein Moradi wrote:
> Dear Sir/ Madam,
>  
> I would like to ask you about mantel test in R. In ade4 package, if I
> want to use mantel.rtest, I get error massage "Object of class to "dist"
> expected". As I already have two dissimilarity matrices, shall I again
> compute distance measure using this function?
> If not, could you please let me know which function/command I can use to
> do?
> Thank you very much in advance and have a nice day!
>  
> Best regards,
> Hossein

If the dissimilarity matrices are full, square, symmetric matrices, then
you can use:

mantel.rtest(as.dist(your_mat1), as.dist(your_mat2))

See ?as.dist

HTH

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC & ENSIS, 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/cv/
 London, UK. WC1E 6BT.         [w] http://www.ucl.ac.uk/~ucfagls/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list