Hi Matt, David, and Jay.

Yes, the general approach described in Ives et al. (2007; Syst. Biol.) is implemented for different univariate tests and methods, including model fitting, in phytools (as well as in geiger); however the regression model of Ives et al. has not yet been implemented in R, so far as I know.

I have made an attempt to write a function for this method, pgls.Ives, and it is now posted to the phytools page (link to code: http://faculty.umb.edu/liam.revell/phytools/pgls.Ives/v0.1/pgls.Ives.R). This version only allows bivariate (y=b0+b1*x+e) regression and a simple Brownian error structure, but does incorporate sampling error in x & y following Ives et al. If the reported sampling error is zero, then the function performs standard PGLS & yields the same estimators as gls(...,correlation=corBrownian(...)).

Note that I just did this today and it has been subjected to very limited testing and it may contain bugs or errors as the math of Ives et al. was not completely straightforward to me in a couple of places (here I tried to use common sense).

> source("pgls.Ives.R")
> args(pgls.Ives)
function (tree, X, y, Vx, Vy, Cxy)

tree is a "phylo" object; X is a *vector* containing x, with names(X) containing the tree tip labels; y is a vector of y with names(y) as before; Vx, Vy, Cxy are vectors with the sampling variances (squared standard errors) or covariances for X, y, and between X and y with names(...) as before.

If anyone would like to compare to Ives & Garland's MATLAB code I would love to hear the result as I only hope I got this right.

All the best, Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com


On 7/16/2012 7:24 PM, Matt Pennell wrote:
David and Jay,

I am not sure if Liam and Graham's was designed for phylogenetic regression
per se. Tony Ives has done exactly this but his code is only in Matlab as
far as I understand.

An alternative would be to use RMA approach for this which Liam has created
(but note Simon Blomberg's warning about this in the comments section):

http://phytools.blogspot.com/2011/04/phylogenetic-rma-regression.html

Another (possibly less problematic) option is to use Joe Felsenstein's
approach which is in the current implementation of the progarm contrast in
the phylip package. This allows one to do independent contrasts on traits
with multiple measurements at the species level.

Comparative Methods with Sampling Error and Within�Species Variation:
Contrasts Revisited and Revised.
Joseph Felsenstein
The American Naturalist , Vol. 171, No. 6 (June 2008), pp. 713-725

Personally I would do this with the R package MCMCglmm as it allows for
greater flexibility in the distribution of the tip values but it is perhaps
more burdensome to run.

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. doi: 10.1111/j.1420-9101.2009.01915.x

hope this helps.

cheers,
matt

On Mon, Jul 16, 2012 at 12:42 PM, Jay Fitzsimmons
<jayfitzsimm...@gmail.com>wrote:

Hello David,

There is at least one package in R that incorporates intraspecific
variation within a phylogenetic context.

phytools.  The method is described in:
Revell, L. J. and R. G. Reynolds. In Press. A new Bayesian method for
fitting evolutionary models to comparative data with intraspecific
variation. Evolution.

http://onlinelibrary.wiley.com/doi/10.1111/j.1558-5646.2012.01645.x/abstract

If others know better than me they should say so because while I plan
to use phytools in the next month for the exact purpose David Winter
describes, I haven't yet done so.

Jay

PS: thank you to everyone on this list - I am teaching myself R and
have found the posts very helpful.

On Wed, Jul 11, 2012 at 11:23 PM, David Winter <david.win...@gmail.com>
wrote:
Hi all,

Sorry if this has been dealt with here before, I searched the list but
couldn't find a thread quite the same as this.

Are there methods in R for performing phylogenetic regression on
datasets with many measurements per tip. We have data from many
individuals that includes a measurement and several ecological
variables that might be expected to predict that measurement. We also
have a species-level phylogeny for these individuals, and we can
happily assign each data point to a tip in this phylogeny.

My first inclination was to crudely incorporate the evolutionary
history of these individuals into our models by making a big polytomy
for each species, but reading Ives et al 2007
(dx.doi.org/10.1080/10635150701313830) it seems there is a model of
phylogenetic regression that include "within-tip variation"? Does
anyone know if this is implemented in R?

It's possible I'm entirely on the wrong track here, in which case I'm
happy to be pointed in another direction!

Thanks in advance for any help you can provide,

David Winter

--
David Winter
PhD Student
Allan Wilson Centre for Molecular Ecology and Evolution
Univeristy of Otago
Dunedin
New Zealand/ Aotearoa

ph + 64 22 018 0449

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



--
Jay Fitzsimmons
PhD candidate
Department of Biology, University of Ottawa
30 Marie Curie, Ottawa, Ontario, Canada, K1N 6N5
http://mysite.science.uottawa.ca/jfitz049//index.html

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://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


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

Reply via email to