tag:blogger.com,1999:blog-8499895524521663926.post8759748756033367319..comments2024-04-21T09:01:42.412-04:00Comments on Phylogenetic Tools for Comparative Biology: Phylogenetic size correction using GLSLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8499895524521663926.post-76664866234304645632022-01-02T08:45:38.575-05:002022-01-02T08:45:38.575-05:00pgls {caper} returns an object of class pgls conta...pgls {caper} returns an object of class pgls containing phyres <br />= the phylogenetic residuals. I was wondering whether this is identical to what is returned by your phyl.resid function?Anonymoushttps://www.blogger.com/profile/14873799524618481788noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-15502515115854488952016-07-15T12:10:23.919-04:002016-07-15T12:10:23.919-04:00Dear Liam,
I'm wondering whether it is accept...Dear Liam,<br /><br />I'm wondering whether it is acceptable to log-transform your variables before using this correction?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/07578348663274168595noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-78935683864189638162016-02-17T11:20:57.742-05:002016-02-17T11:20:57.742-05:00Dear Dr. Revell,
I just started to work with R in...Dear Dr. Revell,<br /><br />I just started to work with R in phylogenetic comparative methods, and I tried your phyl.resid with the BM option to correct for the body size effect in trait correlations. With the matrix of residues after size correction, I calculated the regressions between traits (parameters of cricket songs, the same used by Augustin) using the pGLS function (pGLS packages).<br /><br />I also calculated the lambda for my traits (using the log transformed values, not the residual matrix), and 4 out of 11 traits had values of lambda not significantly different from zero. According to this information, I recalculated the residual matrix using the lambda option in phyl.resid and calculated the regressions again with pGLS. The results are quite different, and I interpreted these differences based on the fact that some traits have lambda = 0, so the correction for phylogeny was not necessary for these traits, right? <br /><br />Here is your answer for Augustin´s question:<br /><br />"Hi Augustin.<br /><br />Yes, your instinct is correct. The residuals from phyl.resid (or, alternatively, using gls in the nlme package & residuals) are still phylogenetically correlated. This is because phylogeny is used to compute the optimal regression line, but the residuals are computed in the original space (not in a phylogenetically transformed space). Thus this is not in fact a 'double correction'.<br /><br />Hope this is helpful.<br /><br />All the best, Liam"<br /><br /><br />Well, I´m trying to finish Augustin's article and help his advisor (Dr. Tony Robillard) with these calculations. Today he told me that I should use the corrected size matrix to calculate lambda since the size can impact the results. Well, I did it (used the phyl.resid with lambda correction), and 10 of my 11 traits have lambda not significantly different from zero, meaning that they do not have phylogenetic signal... Is that correct? And more important, why the phylogenetic signal disapeared if the phyl.resid does not correct for the phylogenetic relationships? I´m really confusing with these results and need your help.<br /><br /><br />Thanks a lot, Karla.Karla Yotokohttps://www.blogger.com/profile/01679235034059187334noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-35960307614201634172015-07-07T09:54:32.785-04:002015-07-07T09:54:32.785-04:00I am also interested in this question. I think mos...I am also interested in this question. I think most studies ignore intraspecific error and just use the average.<br />This study may be relevant:<br />Ives, A. R., Midford, P. E., & Garland, T. (2007). Within-species variation and measurement error in phylogenetic comparative methods. Systematic Biology, 56(2), 252-270.Anonymoushttps://www.blogger.com/profile/07578348663274168595noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-44298018595711691522015-05-12T17:01:49.542-04:002015-05-12T17:01:49.542-04:00Dear Liam
I am new about phylogenetical comparati...Dear Liam<br /><br />I am new about phylogenetical comparative methods and apologize me if this question was made previously. I am trying to do a phylogenetic size-correction (with phyl.resid), then with the residuals obtained perform a phylogenetically PCA (with phyl.pca), and finally with the scores obtained make a manova ( with aov.phylo). I made this with the averages of morphological traits, but I am interested in take account intraspecific variation within a species. <br />As a test I used individual measures and a tree with members of the same species as a polytomy (e.g. " ((bufonius1,bufonius2,bufonius3,bufonius4,bufonius5,bufonius6,bufonius7,bufonius8,bufonius9,bufonius10,(mystacinus1,mystacinus2,mystacinus3,mystacinus4,mystacinus5,mystacinus6,mystacinus7,mystacinus8,mystacinus9,mystacinus10,troglodytes1,troglodytes2,troglodytes3,troglodytes4,troglodytes5,troglodytes6,troglodytes7,troglodytes8,troglodytes9,troglodytes10))" with branch lengths=1 and grafen's branch length ( I don't have branch lengthfor my tree), apparently it works but I dont know if this is a correct form to obtain the residuals, scores etc.<br />thanks a lot in advance<br />best regards<br />ReginaReginahttps://www.blogger.com/profile/16503546064060912378noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-82264155314505294222014-09-10T08:37:49.704-04:002014-09-10T08:37:49.704-04:00First, thanks a lot for this new function and all ...First, thanks a lot for this new function and all the explanations you give on this blog.<br /><br />I'm a student in evolutionary biology and i'm studying evolution of acoustic communication in a cricket genus.<br />I'm working on acoustic, morphological, and acoustic data and i would like to know if there is some corelations between those characters.<br />So, i had to partial out the effect of body size on these characters prior to conduct the analysis. I obtained the residuals size corrected of all my characters.<br />Now, i would like to know correlations between those variables, but i don't know if i have to do "traditional regressions" or pGLS regression on the residuals.<br />I would say, i have to do pGLS regression on the residuals in order to take into account phylogenetic effect, but i'm not sure and i would like to have your point of view.<br /><br />Many thanks for any advice you might be able to provide and apologies for anything that seems naive. <br /><br />Augustin<br />Anonymoushttps://www.blogger.com/profile/08276361145936484479noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-60646563093545365692013-02-13T18:38:02.933-05:002013-02-13T18:38:02.933-05:00Hello Liam,
Thanks for the great package (phytool...Hello Liam,<br /><br />Thanks for the great package (phytools) & functions! I had a couple of questions that I hope are not too naive.<br /><br />1. I have been using different methods to generate residuals from a PGLS (as you describe in your post: http://blog.phytools.org/2012/11/fitting-model-in-phylogenetic.html) I have run your code as described below:<br /><br /><br />METHOD A<br /># using phytools<br />library(phytools)<br /># assuming your data are in named vectors x & y<br />fit.A<-phyl.resid(tree,x,y,method="lambda")<br />fit.A<br /><br />METHOD B<br /># using caper<br />library(caper)<br /># assuming your data are in named vectors x & y<br />y<-y[names(x)]<br />X<-data.frame(x,y,Species=names(x))<br />fit.B<-pgls(y~x,comparative.data(tree,X,"Species"), lambda="ML")<br />residuals(fit.B)<br /><br /><br />and have found that "residuals(fit.A)" are the same as the values in "fit.B". However, <br /><br />residuals(fit.B, phylo=T) <br /><br />provides a different answer and is explained as the "phylogenetic residuals from the PGLS model." I had assumed (probably due to a lack of knowledge on the subject) that the results of phyl.resid would be the "phylogenetic residuals" (i.e. the residuals from a phylogenetically informed GLS model). <br /><br />I would like to use the resulting residuals of the PGLS/phyl.resid in further phylogenetically informed analyses as the size corrected value for my trait of interest (keeping in mind the advice you give in your 2009 Evolution paper). It strikes me though that the "phylogenetic residuals" are the more appropriate metric to be using if one is after a phylogenetically size corrected trait. Might you have any insight into the differences between the result of "phyl.resid" residuals and the "phylogenetic residuals" from a PGLS model?<br /><br />2. Could you say a few words on the methods you use to ensure your analyses fit the assumptions of phyl.resid (keeping in mind the cautions you give in your 2010 "Phylogenetic signal and linear regression on species data" paper and ensuring that phylogenetic analysis is appropriate in the first place).<br /><br />For example, Charlie Nunn and Natalie Cooper suggest removing species that have a studentized residual greater than 3 or less than -3 (http://nunn.rc.fas.harvard.edu/groups/pica/wiki/d8009/751_Running_PGLS_in_R_using_caper.html). Do you think this is equivalently appropriate for the studentized residuals of the phyl.resid residuals to ensure that outliers are removed? Other thoughts on techniques that must be used to assure the data meet the appropriate assumptions?<br /><br />Many thanks for any advice you might be able to provide and apologies for anything that seems naive. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-66878258442456312712011-04-12T14:37:05.903-04:002011-04-12T14:37:05.903-04:00Dave,
I have also posted a new function for phylog...Dave,<br />I have also posted a new function for phylogenetic PCA. I describe it <a href="http://phytools.blogspot.com/2011/04/new-function-phylpca.html" rel="nofollow">here</a> and then (with the inevitable bug fixes) <a href="http://phytools.blogspot.com/2011/04/new-function-phylpca.html" rel="nofollow">here</a>.Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-34114056228170421652011-04-03T13:46:42.678-04:002011-04-03T13:46:42.678-04:00Liam-
Hmm. The most common uses for PCA are for me...Liam-<br />Hmm. The most common uses for PCA are for measuring disparity or visualizing morphospace occupation. Might be a good modeling project for a junior student to do: see what biases are introduced into disparity metrics by using traditional PCA.<br />-Davedwbapsthttps://www.blogger.com/profile/17606476387441191531noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-88091501923090131362011-04-03T13:24:10.223-04:002011-04-03T13:24:10.223-04:00Hi Dave.
Yes, no problem to have a non-ultrametri...Hi Dave.<br /><br />Yes, no problem to have a non-ultrametric tree. One should be able to do this using gls(...,weights) as well.<br /><br />Regarding, your second item - this would seem to be fundamentally an empirical question. However, in my opinion I think it will depend on the purpose of the PCA. For instance, if you ignore phylogeny then the PCs will not be evolutionarily orthogonal; however if the purpose is merely data reduction, this might not be of great consequence.<br /><br />Thanks for the great comment.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-65129146101223671822011-04-03T12:57:24.039-04:002011-04-03T12:57:24.039-04:00Liam,
Does your function account for the differenc...Liam,<br />Does your function account for the differences varinces produced by the differences in tip height in non-ultrametric paleo-trees? (As we've discussed on the list.)<br /><br />Tangentially, since your comment in Evolution on this topic came out, I've been wondering about the application of phylogenetic size-correction and PCA. How problematic is the issue for paleontologists, who generally lack reliable phylogenies but commonly apply PCA and size-correction to their data?<br />-Davedwbapsthttps://www.blogger.com/profile/17606476387441191531noreply@blogger.com