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

Peter Solymos solymos at ualberta.ca
Thu Oct 1 20:01:16 CEST 2009


Dear Steve,

If the direction is important, you can use that information as a
separate matrix with signs to scale up its effect. Because distance
can't be negative, you might end up with numbers hard to interpret.

Yours,

Peter

Péter Sólymos
Alberta Biodiversity Monitoring Institute
Department of Biological Sciences
CW 405, Biological Sciences Bldg
University of Alberta
Edmonton, Alberta, T6G 2E9, Canada
Phone: 780.492.8534
email <- paste("solymos", "ualberta.ca", sep = "@")



On Thu, Oct 1, 2009 at 11:46 AM, Jari Oksanen <jari.oksanen at oulu.fi> wrote:
>
>
>
> On 1/10/09 20:36 PM, "Sarah Goslee" <sarah.goslee at gmail.com> wrote:
>
>> 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.
>>
> Sarah & Steve,
>
> This was the design I had on my mind. However, I was not sure how
> skew-symmetry actually was defined, and therefore I didn't know if free
> permutation of rows and columns (even when done correctly like above) will
> retain the skew-symmetry. The free permutation would be OK for non-symmetric
> matrices, but what about skew-symmetric? (Little thinking and pen & paper
> probably would give a quick answer, but I won't do that for a while).
>
> Cheers, Jari
>
>> 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?)
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>



More information about the R-sig-ecology mailing list