[R-sig-eco] Mantel test with skew-symmetric matrices?

Sarah Goslee sarah.goslee at gmail.com
Thu Oct 1 19:36:16 CEST 2009


I can only speak for the mantel() within ecodist, but I can tell you that it
will not take full matrices - the upper triangle will be dropped. You could
roll your own very easily, but it would be exceedingly slow, eg:

mat1 <- # some square skew-symmetric matrix
mat2 <- # some other square skew-symmetric matrix

mantelr <- cor(as.vector(mat1), as.vector(mat2))
nperm <- 100 # bigger for real problem, of course
permresults <- numeric(nperm)
permresults[1] <- mantelr

for(thisperm in 2:nperm) {
   randsample <- sample(1:nrow(mat1))
   permresults[thisperm] <- cor(as.vector(mat1[randsample,
randsample]), as.vector(mat2))
}
and then use permresults to estimate your test statistic of interest.

I haven't thought at all about any statistical issues raised by use of full
non-symmetric matrices - you're on your own there. It's certainly
*possible*, and
I don't see any immediate reason why it would be wrong, but haven't
pondered the issue.

I see Jari replied as well while I was writing - as for vegan, the
ecodist function would
need to be heavily modified to do this. If I'm persuaded that there's
enough interest,
I could add it to the list.

Sarah

On Thu, Oct 1, 2009 at 1:20 PM, Steve Arnott <ArnottS at dnr.sc.gov> wrote:
> Hello All,

> 1) Is it wrong to use skew-symmetric matrices - i.e. should I just forget about the skew data and use absolute values to make all my matrices symmetric? The original Mantel paper (1967, Cancer Research, 2: 209-220) does talk about skew-symmetric matrices, but the published applications I've come across only seem to use symmetric matrices.
>
>  2) If it is ok to use skew-symmetric matrices, do the mantel() and mantel.partial() functions in 'vegan' (or related functions in other packages, such as 'ecodist') handle them correctly? I've found that it is possible to process skew data and generate results using these functions, but I'm uncertain from the documentation whether the results are meaningful (i.e. is the coding designed to handle such cases appropriately?)

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list