Re: [R-sig-phylo] multiple traits measured within species

2012-03-13 Thread Kaspar Delhey

Hi,

thanks Rafael and Emmanuel for further input into this problem. I have 
followed Rafael's advice and tried to use MCMCglmm with the help of 
Shinichi Nakagawa. This seems to provide again sensible results, however 
I would also be interested in following the procedure suggested by 
Emmanuel, since ideally I would like to see these results confirmed 
using different methods. I have just finished reading the new version of 
chapter 6 in the new book and am thinking how to implement this. I will 
probably contacting Emmanuel for further advice on that.


Thanks again for all the help!

best

Kaspar

On 12/03/2012 18:52, Emmanuel Paradis wrote:

Hi Kaspar, Matt, Marguerite and others,

I provide an overview of the issue of intraspecific variation in 
comparative methods in the 2nd edtion of my book. Specifically, there 
are functions pic.ortho and varCompPhylip (the latter requiring Phylip 
on your machine) which implement most of the methods described in 
Felsenstein (2008). I also describe how to implement Garland  Ives's 
(2007) method (measurement-error model), and a few other things. 
Besides, I show how to expand a covariance matrix to include 
intraspecific covariance parameters (that should be able to be 
estimated with gls). I don't think this has been used yet. Kaspar, if 
you are interested in using this, you may contact me if you need more 
details.


Best,

Emmanuel

Kaspar Delhey wrote on 12/03/2012 08:00:

Hi Marguerite and Matt,

thanks for your comments I should perhaps explain better the analysis I
am trying to do which I tried to avoid first because it is lengthy and
complicated (you have been warned continue reading at your own peril):

The idea is to test for co-evolution between plumage colours and visual
sensitivities in a clade of birds (fairy-wrens) where different species
have different types of visual sensitivities. In birds this degree of
variation in visual sensitivities within a small clade is rare and bird
visual sensitivities fall into two main groups (U-type and V-type eyes,
the former being more sensitive to ultraviolet light). This is a
two-level factor in my analysis and invariant within species.

In this particular clade there seems to be a correlation between having
U-type eyes and presence of blue plumage (Ödeen et al. 2011 Proc. R.
Soc. B), and the explanation behind this could be that U-type eyes are
better at perceiving variation in blue colours than V-type eyes (which
are also ancestral). Since for 12 species in this clade I had colour
(reflectance) measurements of multiple males in breeding plumage I
quantified, using visual models, whether U- or V-type eyes were better
at uncovering the variability between male colours (as is expected of
females choosing mates based on plumage colour). Given that variation in
blue colours was hypothesised to be easier to perceive by U-type eyes, I
tried to include as many colour patches as possible in order to compare
blue vs. non-blue colours. Some species have both blue and non-blue
colours, others only one type and some of them have fewer measured
colour patches (due to technical reasons).

Visual inspection of results indicate that in almost all cases U-type
eyes are better than V-type eyes at discriminating colour variation
between males and thus I computed the difference between U- and V-type
eyes as an index of how much better U-type eyes performed. My
expectation here was that it would be at discriminating blue colours.
This was not the case as this difference was larger for non-blue
colours. This trend is confirmed if instead of using the factor
blue/non-blue we use a continuous descriptor of colours (which goes from
red to ultraviolet) as explanatory variable and plot this against the
difference in performance between U- and V-type eyes.

What also becomes evident from this plot is that this difference in
performance is larger for colours belonging to species with U-type eyes,
no matter what type of colours. In other words, plumage colours of
species with U-type eyes seem to show chromatic variation that appears
well suited to be discriminated by U-type eyes, something we could
expect from the coevolution between colours and visual sensitivities.

If I would analyse these data ignoring phylogenetic relatedness I would
use mixed models including, as fixed effects, eye type (a factor with
two levels: U- or V-type) and a continuous covariate describing the
colour (from red to UV). Species identity would be a random factor in
order to control for multiple patches measured within each species.
Results from such a model confirm the patterns described above.

Off course I would like to see these results confirmed controlling for
phylogenetic relatedness which prompted the attempt described in my
previous e-mail to the list. I have also computed the species-specific
averages and carried out the analyses on 12 data points while
controllinh for phylogenetic relatedness. This analysis confirms the
mixed model results but with 

Re: [R-sig-phylo] multiple traits measured within species

2012-03-11 Thread Kaspar Delhey

Hi Marguerite and Matt,

thanks for your comments I should perhaps explain better the analysis I 
am trying to do which I tried to avoid first because it is lengthy and 
complicated (you have been warned continue reading at your own peril):


The idea is to test for co-evolution between plumage colours and visual 
sensitivities in a clade of birds (fairy-wrens) where different species 
have different types of visual sensitivities. In birds this degree of 
variation in visual sensitivities within a small clade is rare and bird 
visual sensitivities fall into two main groups (U-type and V-type eyes, 
the former being more sensitive to ultraviolet light). This is a 
two-level factor in my analysis and invariant within species.


In this particular clade there seems to be a correlation between having 
U-type eyes and presence of blue plumage (Ödeen et al. 2011 Proc. R. 
Soc. B), and the explanation behind this could be that U-type eyes are 
better at perceiving variation in blue colours than V-type eyes (which 
are also ancestral). Since for 12 species in this clade I had colour 
(reflectance) measurements of multiple males in breeding plumage I 
quantified, using visual models, whether U- or V-type eyes were better 
at uncovering the variability between male colours (as is expected of 
females choosing mates based on plumage colour). Given that variation in 
blue colours was hypothesised to be easier to perceive by U-type eyes, I 
tried to include as many colour patches as possible in order to compare 
blue vs. non-blue colours. Some species have both blue and non-blue 
colours, others only one type and some of them have fewer measured 
colour patches (due to technical reasons).


Visual inspection of results indicate that in almost all cases U-type 
eyes are better than V-type eyes at discriminating colour variation 
between males and thus I computed the difference between U- and V-type 
eyes as an index of how much better U-type eyes performed. My 
expectation here was that it would be at discriminating blue colours. 
This was not the case as this difference was larger for non-blue 
colours. This trend is confirmed if instead of using the factor 
blue/non-blue we use a continuous descriptor of colours (which goes from 
red to ultraviolet) as explanatory variable and plot this against the 
difference in performance between U- and V-type eyes.


What also becomes evident from this plot is that this difference in 
performance is larger for colours belonging to species with U-type eyes, 
no matter what type of colours. In other words, plumage colours of 
species with U-type eyes seem to show chromatic variation that appears 
well suited to be discriminated by U-type eyes, something we could 
expect from the coevolution between colours and visual sensitivities.


If I would analyse these data ignoring phylogenetic relatedness I would 
use mixed models including, as fixed effects, eye type (a factor with 
two levels: U- or V-type) and a continuous covariate describing the 
colour (from red to UV). Species identity would be a random factor in 
order to control for multiple patches measured within each species. 
Results from such a model confirm the patterns described above.


Off course I would like to see these results confirmed controlling for 
phylogenetic relatedness which prompted the attempt described in my 
previous e-mail to the list. I have also computed the species-specific 
averages and carried out the analyses on 12 data points while 
controllinh for phylogenetic relatedness. This analysis confirms the 
mixed model results but with less power.


I see Matt's point that we have no idea what evolutionary model accounts 
for differences within species in this case. Does this also preclude 
computing species-specific averages? What are we assuming then?


I will explore the possibilities in the papers suggested by Matt but a 
first quick reading seems to indicate that there are designed to deal 
with between-individual variation and not variation between traits.


Thanks again for the suggestions (and for reading so far!) and I 
certainly would appreciate any further ideas on how to analyse these data.


best wishes

Kaspar



On 11/03/2012 16:23, Marguerite Butler wrote:

Dear Kaspar,

Are your traits the same? Basically, are the seven color patches on the same 
individual all one trait, or are they seven traits? Do all species have the 
seven color patches? Or are the number of color patches variable? (this could 
also be a character).

I think before you attempt a comparative analysis, it is helpful to think about 
how you would set up a standard statistical analysis, for example some sort of 
ANOVA.

I am not sure I understand your description clearly. It sort of sounds like you are considering the 
multiple color patches as repeated measures of color patch on the same individual, but then you 
want to include them all as separate traits in the analysis. You could consider them as repeated 

Re: [R-sig-phylo] multiple traits measured within species

2012-03-11 Thread Rafael Maia
Hello Kaspar, 

I am new to phylogenetic comparative methods, so I may not be of much help, but 
I am dealing with similar questions that you are, so hopefully I can at least 
help the discussion in a useful way!

First, I tried to sort out your main questions, which seem to be:

- Are U- and V-type eyes better at sorting out colors?
- Is this difference color-dependent; i.e. is the difference between U- and 
V-type eyes stronger for blue colors than for red colors?

So it seems you have:

- a response variable which says how discernible the color is (I'm guessing 
some deltaS measurement, between the color and the background or the color and 
the other colors in a bird's body?) 
- a predictor variable for eye type (U- or V-, factor, two levels)
- a predictor variable for the color descriptor (a continuous variable, from 
blue to red)

And you'd be particularly interested in the effect of eye type and its 
interaction with the color descriptor.

So it seems to me that most models would be a problem for you because they 
assume some model of trait evolution across the phylogeny, which also relates 
to the within-species variability (as you pointed out, this is usually 
between-individual, within-species variation), which might become a problem. 
From a purely modeling perspective, however, the main issue you're trying to 
deal with is have residual error that is uncorrelated to phylogenetic 
relationships. So it seems to me that this is an issue similar to that faced by 
those attempting to conduct phylogenetic meta-analysis, where multiple effects 
obtained from each species also don't represent inter-individual variability, 
but a random sample from a population of effect sizes of that species. 

So, if in the same way, you can assume that your measurements of color 
discriminability are a random sample of effects for that species, your 
situation might be analogous, and the MCMCglmm implementation of Hadfield  
Nakagawa (detailed in the reference Matt pointed out earlier) might solve your 
problem, allowing you to add phylogenetic non-independence together with 
additional random effects in order to obtain your fixed effects estimates under 
uncorrelated residuals. However, I believe some (many?) will be uneasy with 
this approach, as it may have implicit assumptions about the model of trait 
evolution I am not considering, which may be problematic since the traits 
included are not homologous and the variation between samples within species 
are not being explicitly modeled in an evolutionary framework.

Still, I hope it helps! And best of luck in the project - As a fellow 
bird-color enthusiast, I find it very interesting! ;)

Abraços,
Rafael Maia
---
webpage: http://gozips.uakron.edu/~rm72
A little learning is a dangerous thing; drink deep, or taste not the Pierian 
spring. (A. Pope)
Graduate Student - Integrated Bioscience
University of Akron
http://gozips.uakron.edu/~shawkey/

On Mar 11, 2012, at 9:00 PM, Kaspar Delhey wrote:

 Hi Marguerite and Matt,
 
 thanks for your comments I should perhaps explain better the analysis I am 
 trying to do which I tried to avoid first because it is lengthy and 
 complicated (you have been warned continue reading at your own peril):
 
 The idea is to test for co-evolution between plumage colours and visual 
 sensitivities in a clade of birds (fairy-wrens) where different species have 
 different types of visual sensitivities. In birds this degree of variation in 
 visual sensitivities within a small clade is rare and bird visual 
 sensitivities fall into two main groups (U-type and V-type eyes, the former 
 being more sensitive to ultraviolet light). This is a two-level factor in my 
 analysis and invariant within species.
 
 In this particular clade there seems to be a correlation between having 
 U-type eyes and presence of blue plumage (Ödeen et al. 2011 Proc. R. Soc. B), 
 and the explanation behind this could be that U-type eyes are better at 
 perceiving variation in blue colours than V-type eyes (which are also 
 ancestral). Since for 12 species in this clade I had colour (reflectance) 
 measurements of multiple males in breeding plumage I quantified, using visual 
 models, whether U- or V-type eyes were better at uncovering the variability 
 between male colours (as is expected of females choosing mates based on 
 plumage colour). Given that variation in blue colours was hypothesised to be 
 easier to perceive by U-type eyes, I tried to include as many colour patches 
 as possible in order to compare blue vs. non-blue colours. Some species have 
 both blue and non-blue colours, others only one type and some of them have 
 fewer measured colour patches (due to technical reasons).
 
 Visual inspection of results indicate that in almost all cases U-type eyes 
 are better than V-type eyes at discriminating colour variation between males 
 and thus I computed the difference between U- and V-type eyes as an index of 
 how much better U-type eyes performed. My 

Re: [R-sig-phylo] multiple traits measured within species

2012-03-10 Thread Marguerite Butler
Dear Kaspar,

Are your traits the same? Basically, are the seven color patches on the same 
individual all one trait, or are they seven traits? Do all species have the 
seven color patches? Or are the number of color patches variable? (this could 
also be a character). 

I think before you attempt a comparative analysis, it is helpful to think about 
how you would set up a standard statistical analysis, for example some sort of 
ANOVA.

I am not sure I understand your description clearly. It sort of sounds like you 
are considering the multiple color patches as repeated measures of color patch 
on the same individual, but then you want to include them all as separate 
traits in the analysis. You could consider them as repeated measurements of a 
single color patch trait, in which case you would include the individual and 
species as factors in your analysis. Or you could consider each patch a 
different trait, and then compare them across species, so that each color patch 
is a separate dependent variable (in which case color patch 1 would be the 
same trait across individuals and species, etc.). Or you could take the mean of 
all color patches within an individual and use that in an analysis across 
individuals and species. 

Do you have any clues from development as to their identity? It seems like you 
want to consider them all to be replicates of the same measure.  But then why 
measure so many? I assume there is variation among color patches within an 
individual? Ultimately you will have to decide if 3 color patches is one trait 
or if it is three traits. After you decide this, it will be much easier to 
design a comparative analysis. 

Good luck,
Marguerite

On Mar 6, 2012, at 2:42 PM, Kaspar Delhey wrote:

 Hello,
 
 I was wondering whether I could get some input into the following analysis:
 
 I am interested to test for the association between one dependent variable 
 (continuous, normal) and one factor and a covariate while accounting for 
 phylogenetic relatedness. In my analysis I have 12 species and I have 
 measured the dependent variable and the covariate (which are both colour 
 descriptors) on several patches per species (between 1 and 7 patches per 
 species). The factor (the type of visual sensitivity) does not vary within 
 species. Thus the repeated observations per species do not correspond to 
 different individuals but are different patches of colour in the same 
 individual, measured on the same scale and units (hence directly comparable).
 
 Does it make sense to make use of the whole dataset (i.e. without computing 
 species averages) by replacing each tip in the phylogeny by a polytomy 
 including all patches measured in that particular species?
 
 For example if I have this tree:
 
 (A, (B, C))
 
 and I have measured two patches of colour in sp. A and three in spp B and C  
 I could replace the tips in this tree by:
 
 ((A1,A2),((B1,B2,B3),(C1,C2,C3)))
 
 
 In this way I could use a gls approach with nlme and for example corPagel 
 such as:
 
 model1-gls(dep.var~factor+covariate, correlation=Pagel, method=REML, 
 data=data)
 
 The results that I obtain from such a model make sense and qualitatively 
 agree with the results from a mixed model including species ID as a random 
 factor but ignoring phylogenetic relatedness between species.
 
 My question then is whether there is a flaw in this analysis and whether it 
 has been used before in other publications in order to be able to include 
 references to back it up.
 
 Thanks in advance for any help.
 
 best
 
 kaspar
 
 
 
 
 -- 
 Kaspar Delhey
 e-mail: kaspar.del...@monash.edu
 https://sites.google.com/site/kaspardelhey/
 Tel:+61-(0)3-99020377
 Bldg.18 School of Biological Sciences
 Monash University
 Clayton, 3800 Victoria
 Australia
 
 ___
 R-sig-phylo mailing list
 R-sig-phylo@r-project.org
 https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] multiple traits measured within species

2012-03-09 Thread Matt Pennell
Hi Kaspar and others,

Sorry for responding so late to this. I am not sure if there exists any
precedent for doing this but it seems problematic. We do not expect BM
alone (or a variant thereof) to be a good model to account for variation
within a species and I would strongly recommend against doing what you
propose.

However, there have been several methods published directly relevant to
this that are worth checking out. Someone else on the list may have more
insight than me on this (and please correct me if i am wrong).

There exists a PGLS-esque method which I believe is available only in
matlab...

Ives, A.R., Midford, P.E.  Garland, T. 2007. Within-species variation and
measurement error in phylogenetic comparative methods. Syst. Biol. 56:
252–270.


And for a contrast-based approach, Felsenstein has developed machinery
which has the advantage of simultaneously estimating the variances. It is
coded up and availalbe in PHYLIP within the contrast program.


Felsenstein, J. 2008. Comparative methods with sampling error and
within-species variation: contrasts revisited and revised. Am. Nat. 171:
713–725.

There is also some discussion of this in:

HADFIELD, J. D. and NAKAGAWA, S. (2010), General quantitative genetic
methods for comparative biology: phylogenies, taxonomies and multi-trait
models for continuous and categorical characters. Journal of Evolutionary
Biology, 23: 494–508.

Hope this is helpful.

cheers
matt







On Tue, Mar 6, 2012 at 4:42 PM, Kaspar Delhey kaspar.del...@monash.eduwrote:

 Hello,

 I was wondering whether I could get some input into the following analysis:

 I am interested to test for the association between one dependent variable
 (continuous, normal) and one factor and a covariate while accounting for
 phylogenetic relatedness. In my analysis I have 12 species and I have
 measured the dependent variable and the covariate (which are both colour
 descriptors) on several patches per species (between 1 and 7 patches per
 species). The factor (the type of visual sensitivity) does not vary within
 species. Thus the repeated observations per species do not correspond to
 different individuals but are different patches of colour in the same
 individual, measured on the same scale and units (hence directly
 comparable).

 Does it make sense to make use of the whole dataset (i.e. without
 computing species averages) by replacing each tip in the phylogeny by a
 polytomy including all patches measured in that particular species?

 For example if I have this tree:

 (A, (B, C))

 and I have measured two patches of colour in sp. A and three in spp B and
 C  I could replace the tips in this tree by:

 ((A1,A2),((B1,B2,B3),(C1,C2,**C3)))


 In this way I could use a gls approach with nlme and for example corPagel
 such as:

 model1-gls(dep.var~factor+**covariate, correlation=Pagel, method=REML,
 data=data)

 The results that I obtain from such a model make sense and qualitatively
 agree with the results from a mixed model including species ID as a random
 factor but ignoring phylogenetic relatedness between species.

 My question then is whether there is a flaw in this analysis and whether
 it has been used before in other publications in order to be able to
 include references to back it up.

 Thanks in advance for any help.

 best

 kaspar




 --
 Kaspar Delhey
 e-mail: kaspar.del...@monash.edu
 https://sites.google.com/site/**kaspardelhey/https://sites.google.com/site/kaspardelhey/
 Tel:+61-(0)3-99020377
 Bldg.18 School of Biological Sciences
 Monash University
 Clayton, 3800 Victoria
 Australia

 __**_
 R-sig-phylo mailing list
 R-sig-phylo@r-project.org
 https://stat.ethz.ch/mailman/**listinfo/r-sig-phylohttps://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo