Steve Arnott | 1 Oct 19:20
Favicon

Mantel test with skew-symmetric matrices?

Hello All,

I'm interested in using the mantel()and mantel.partial() functions in the 'vegan' R package to examine
fish morphology in several lakes with respect to distance between lakes, lake elevation (above sea
level) and various habitat measures. For example, several authors have postulated that jaw length
varies with habitat conditions, but jaw length, lake distance, elevation and the habitat measures
co-vary. Applying a partial Mantel to control for elevation or lake distance seems like a good way of
attacking the problem.

Typically, Mantel tests are performed using symmetrical distance matrices based upon absolute
distances. For example, a symmetrical matrix of distances between 3 lakes might look like this:

0 7 3
7 0 4
3 4 0

This makes sense with distance data (miles, km, etc), but information is lost on the direction of effect
between lakes with data such as jaw length or elevation. Instead, a so-called skew-symmetric matrix can
be generated, which would instead look something like this:

 0  7  3
-7  0 -4
-3  4  0

I have two questions:

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.
(Continue reading)

Jari Oksanen | 1 Oct 19:31
Picon
Picon
Favicon

Re: Mantel test with skew-symmetric matrices?

Steve,

My answer concerning the vegan part is so short that I top-post (my
apologies for those who are sensitive about this): No, you cannot use
non-symmetric matrices in mantel() functions in vegan. The functions use the
standard R distance objects which are regarded as symmetric. If you supply a
non-symmetric matrix, only its lower triangle will be used. Changing this
would require redesign of the functions. Contributions are welcome and will
be credited in the vegan manual pages to their authors.

Best wishes, Jari Oksanen

On 1/10/09 20:20 PM, "Steve Arnott" <ArnottS@...> wrote:

> Hello All,
> 
> I'm interested in using the mantel()and mantel.partial() functions in the
> 'vegan' R package to examine fish morphology in several lakes with respect to
> distance between lakes, lake elevation (above sea level) and various habitat
> measures. For example, several authors have postulated that jaw length varies
> with habitat conditions, but jaw length, lake distance, elevation and the
> habitat measures co-vary. Applying a partial Mantel to control for elevation
> or lake distance seems like a good way of attacking the problem.
> 
> Typically, Mantel tests are performed using symmetrical distance matrices
> based upon absolute distances. For example, a symmetrical matrix of distances
> between 3 lakes might look like this:
> 
> 0 7 3
> 7 0 4
(Continue reading)

Sarah Goslee | 1 Oct 19:36
Picon

Re: Mantel test with skew-symmetric matrices?

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.
(Continue reading)

Jari Oksanen | 1 Oct 19:46
Picon
Picon
Favicon

Re: Mantel test with skew-symmetric matrices?


On 1/10/09 20:36 PM, "Sarah Goslee" <sarah.goslee@...> 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).
(Continue reading)

Peter Solymos | 1 Oct 20:01
Picon
Picon
Favicon
Gravatar

Re: Mantel test with skew-symmetric matrices?

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
(Continue reading)

Sarah Goslee | 1 Oct 19:56
Picon

Re: Mantel test with skew-symmetric matrices?

On Thu, Oct 1, 2009 at 1:46 PM, Jari Oksanen <jari.oksanen@...> wrote:
>
>
> 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).

Exactly. It would need some thinking through, and I don't have a quick answer.

Steve asked elsewhere what I thought about using just the symmetric component.
It depends on whether directionality is important: if the distance
from A to B is
not the same as the distance from B to A, then discarding that information
would not give the same results. But then you're out of Mantel test
territory, and
into network analysis or something similar.

That directional component could be problematic, especially if as Jari mentions,
the permutation must preserve that skew-symmetry (mine doesn't). You
could instead
permute the matrix by reordering the rows and columns, then forcing
the lower triangle
to be positive and the upper to be negative.

Sarah
(Continue reading)

Favicon

Negative binomial

Hi all,

1st time user here!
I am an ecologist working with marine fouling assemblages. I just got a paper back for revision. I am working
with count data (species richness). I have used a linear model but the reviewers are recommending the use
of negative binomial or Poisson. As far as I could understand from the literature these complex models
should be used and the distribution is skewed left (lots of zeros). Well, my data is perfectly normal
distributed. My main question is: can I still use negative binomial or poisson even if my data is normal?
Does that make sense?

Thanks in advance

João Canning Clode, PhD
Postdoctoral Fellow
Marine Invasions Research Lab
Smithsonian Environmental Research Center
647 Contees Wharf Road
Edgewater, MD 21037

Email: canning-clodej@...
Web: www.canning-clode.com
Tel: 443-482-2354
Stratford, Jeffrey | 1 Oct 21:12
Favicon

Re: Negative binomial

Oi Joao,

>From my understanding of the Poisson, as the Poisson mean (lambda) increases, the distribution
converges with the mean.  I believe there are also issues with the intercept since counts cannot be
negative.  If the variance is excessive (var/df >> 1) then switch to negative binomial. So go ahead with the
Poisson first then check results.   

This is my first post with my stats cap on.. and I'll let others decide if I'm right (I'll do a little dance if I am).

HTH,

Jeff

 
********************************************
Dr. Jeffrey A. Stratford
Assistant Professor of Biology 
Department of Biology and Health Sciences
WIlkes University, PA 18766
570-332-2942 (cell and preferred)
570-408-4761 (office) 
http://web.wilkes.edu/jeffrey.stratford/
********************************************


-----Original Message-----
From: r-sig-ecology-bounces@...
[mailto:r-sig-ecology-bounces <at> r-project.org] On Behalf Of Canning-Clode, Joao
Sent: Thursday, October 01, 2009 2:30 PM
To: r-sig-ecology@...
(Continue reading)

Luciano Selzer | 1 Oct 21:26
Picon

Re: Negative binomial

Hi Joao, this is my first post of stats.
I think that they are sugesting Poisson or Negative Binomial distribution
because they are discrete distribution as is your data. You can use Normal
distribution as aproximation as it has a continous distribution.

Hope that helps
Bye
Luciano

2009/10/1 Canning-Clode, Joao <Canning-ClodeJ@...>

> Hi all,
>
> 1st time user here!
> I am an ecologist working with marine fouling assemblages. I just got a
> paper back for revision. I am working with count data (species richness). I
> have used a linear model but the reviewers are recommending the use of
> negative binomial or Poisson. As far as I could understand from the
> literature these complex models should be used and the distribution is
> skewed left (lots of zeros). Well, my data is perfectly normal distributed.
> My main question is: can I still use negative binomial or poisson even if my
> data is normal? Does that make sense?
>
> Thanks in advance
>
> João Canning Clode, PhD
> Postdoctoral Fellow
> Marine Invasions Research Lab
> Smithsonian Environmental Research Center
> 647 Contees Wharf Road
(Continue reading)

Carsten Dormann | 2 Oct 08:29
Picon
Favicon

Re: Negative binomial

Dear Joao,

I propose you do the following (and wait for the outcry-responses to 
this email to see if it is a reasonable proposal):

Fit your model with different types of distributions and compare their 
logLik-values:
logLik(glm(y ~ x1+x2+x3+I(x1^2) + x1:x3, family=gaussian))
logLik(glm(y ~ x1+x2+x3+I(x1^2) + x1:x3, family=poisson))
logLik(glm(y ~ x1+x2+x3+I(x1^2) + x1:x3, family=quasipoisson))
logLik(glm.nb(y ~ x1+x2+x3+I(x1^2) + x1:x3)) # require(MASS)

The model with the highest log-Likelihood is the distribution of choice 
and you can defend it against reviewer.

A few notes:
1. You obviously cannot do this when one of the models uses transformed 
responses (e.g. log(y)), because the LL will then be completely different.
2. When you use a more complex model (say a GLMM), you can approximate 
the neg.bin through a two-step procedure: 1. fit a (wrongly structured) 
glm.nb and extract the theta value from the summary of the model, say 
theta=4.5 (that is the second parameter of the neg.bin distribution). 
Then fit the GLMM again, giving as family the argument: 
negative.binomial(theta=4.5) (again from package MASS). The same holds 
for GAMs and other models requiring a specification of family.
3. You may want to dig around for books recommending the above 
procedure. I think I got this as advice from someone else, but haven't 
bothered yet to look it up (obviously MASS would be a good starting 
place, in their description of the neg.bin). I saw a paper that does 
this (using the minimum AIC but otherwise this approach), but it is not 
(Continue reading)


Gmane