tag:blogger.com,1999:blog-8499895524521663926.post3964270123694662200..comments2021-09-27T14:55:41.504-04:00Comments on Phylogenetic Tools for Comparative Biology: R function for Pagel's 1994 correlation methodLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8499895524521663926.post-89772898698315149492020-11-01T11:49:36.597-05:002020-11-01T11:49:36.597-05:00Dear Kostadin.
I suggest that you graph the fitte...Dear Kostadin.<br /><br />I suggest that you graph the fitted model using the plot method for the object that is created by fitPagel. An example of that can be seen on my blog (e.g., <a href="http://blog.phytools.org/2020/08/fixing-root-state-in-analysis-using.html" rel="nofollow">here</a>). Graphing the model will help tell you if the process of evolution is one in which particular combinations of character states tend to accumulate disproportionately. (This is what we expect under a correlated evolution model.)<br /><br />I also suggest graphing the data at the tips of the tree. This might be done using, for instance, plotTree.datamatrix. This should help tell you if your model is being determined by just a small number of improbable correlated changes (in which case, you should have low confidence in the result) or by many correlated changes (in which case your confidence might be higher).<br /><br />All the best, LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-9979970294336957612020-11-01T08:16:45.006-05:002020-11-01T08:16:45.006-05:00Dear Liam,
I follow your blog with great enthusia...Dear Liam,<br /><br />I follow your blog with great enthusiasm. Thank you for providing such valuable information.<br /><br />I performed the tests as explained and received statistically significant difference, but I am not really sure how to interpret the matrix. I understand that x and y are correlated, but I would like to see how the exact changes of the variable states are correlated. However, to give you an example, I compare morphological traits i.e. spines - presence/absence; spots - presence/absence. I want to see if the appearance of spines means losing the spots and vice versa. Do I need a post hoc test, or the matrix is enough for such conclusion?<br /><br />Thank you very much in advance!<br /><br />Cheers,<br />KostadinAnonymoushttps://www.blogger.com/profile/03185183106653331156noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-8224684956581812232020-03-23T12:02:28.131-04:002020-03-23T12:02:28.131-04:00Hi Liam,
Thank you so much for your prompt respon...Hi Liam,<br /><br />Thank you so much for your prompt response.<br /><br /> I changed the method to "fitDiscrete" and now I'm getting a reasonable non-negative LR. However, I was also wondering if I could use different models in the fitPagel function, beyond the ER and the ARD (something like GTR). I tried to specify some models on a matrix and then pass it to the fitPagel, and also inspecting the function trying to chance the iQ matrix but it just says that the model is invalid, and uses ARD as default. Another related question, is that I calculated weigthed AIC for the three models (ER,ARD, and SYM(ER)), for the two individual traits that I'm using, but what if they have different models as the best fit?<br /><br />Also, just to be sure, if I'm getting that the correlation is significant (LR=14.49, p-value<0.001) how do I know if the traits are negatively or positively correlated? (I suspect they are negatively correlated because a naive, not phylogenetically corrected Pearson correlation coefficient is negative). <br /><br />Finally, I was wondering if there's any way to account for incomplete sampling, because I have phenotypic data for more species than I have in the phylogeny, and the genera are monophyletic, and I would like to include this data. <br /><br />Sorry for the many and very basic questions but I'm just very new to this...<br /><br />Thank you so much in advance,<br /><br />Wendy<br /><br />Valenaturahttps://www.blogger.com/profile/17218200861234811952noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-870218640462024482020-03-20T14:13:32.541-04:002020-03-20T14:13:32.541-04:00Hi Wendy.
If your LR is -16.2 that's bad. It...Hi Wendy. <br /><br />If your LR is -16.2 that's bad. It means that your dependent model has a worse likelihood than your independent model - even though the former has the latter as a special case! What it must mean is that your dependent model failed to optimize. <br /><br />As a first step, you could change the value of method - which sets the function that is used internally for optimization. (That is, if you had method="fitMk" you can change it to method="fitDiscrete", and vice versa.) <br /><br />If that doesn't work, please save & email me your R workspace & the command that creates this problem via email and I'll look into it.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-2712210279291270082020-03-20T12:31:50.437-04:002020-03-20T12:31:50.437-04:00Hi Liam,
I hope you are well
I was wondering how...Hi Liam,<br /><br />I hope you are well<br /><br />I was wondering how this could be apply to estimate significant negative correlation between traits. For my correlation between two traits, my likelihood-ratio ratio is negative -16.19662, and the p-value is 1, which for me looks very suspicious given that this likelihood ratio is pretty high. Therefore, I was wondering that maybe it is not testing for negative correlation.<br /><br />Thank you so much in advance!<br /><br />WendyValenaturahttps://www.blogger.com/profile/17218200861234811952noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-38097451371050679532016-05-24T10:08:47.531-04:002016-05-24T10:08:47.531-04:00Yes, the amount of time in your tree for things to...Yes, the amount of time in your tree for things to occur is the sum of the edge lengths. Exactly.Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-9415516570776716542016-05-15T20:16:14.198-04:002016-05-15T20:16:14.198-04:00Hi,
Edit--sorry, I just realised it probably mak...Hi, <br /><br />Edit--sorry, I just realised it probably makes more sense for 1 to be one unit of time in my tree... If the sum of the branch lengths is 9.5, are there 9.5 "units of time" in my tree?<br /><br />Best, <br />Caitlin. Anonymoushttps://www.blogger.com/profile/04632917697970136421noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-63929000477211620082016-05-15T20:12:33.605-04:002016-05-15T20:12:33.605-04:00Hello again,
Thank you very much for your advice...Hello again, <br /><br />Thank you very much for your advice. <br /><br />I believe I understand your first point. The example you gave would correspond to the fact that in an independent Q rate matrix, the contents of the cells [1,3] and [2,4] will be equal, correct?<br /><br />With regard to your second point, though, I confess to remaining a little unsure of myself. I think I agree that the rates are more easily interpreted as numbers of substitutions per unit time. If you have a moment, could I please try to run a small example past you to see if I am understanding you correctly?<br /><br />Suppose I have an independent rate matrix, iQ, and I want to use the rates estimated therein to simulate data on a given tree. The rate Q(b|a->a|a) (also Q(b|b->a|b)) in my iQ is 0.79, which is the expected number of changes to occur in a unit time. <br /><br />My tree is not a timed tree, but I can use max(nodeHeights(tree)) to get its height, which is 1.4. The sum of the branch lengths in my tree is 9.5. Am I correct in thinking that there are 9.5/1.4=6.79 “units of time” in my tree? If so, would the expected value of the number of substitutions to occur for this variable, throughout the tree, be 0.79*6.79=5.36? <br /><br />Finally, if I wanted to simulate data for this variable on this tree using this rate estimate, what would be the recommended procedure for getting an actual value for the number of substitutions to occur in a given simulation (for example, should I round down to 5, or draw a number from a Poisson distribution with parameter 5.36)? <br /><br />I really appreciate your taking the time to read my comments and offer your input. <br /><br />Thanks sincerely, <br />Caitlin. Anonymoushttps://www.blogger.com/profile/04632917697970136421noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-62230554149636497562016-04-11T23:38:10.607-04:002016-04-11T23:38:10.607-04:00Hi Caitlin.
The rate Q(a|a -> b|a), for instan...Hi Caitlin.<br /><br />The rate Q(a|a -> b|a), for instance, is the instantaneous rate of transition from a->b in character 1, given that character 2 is in state a. In the independent model, the rate of change in 1 cannot be influenced by character 2, consequently Q(a|a->b|a)==Q(a|b->b|b) & so on.<br /><br />The rates become probabilities after matrix exponentiation of Q*t for elapsed time t; however another intuitive interpretation is that for a lineage starting in state a with Q(a->b)=2, the expected number of changes in a unit of time is 2.<br /><br />Hope this helps. LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-80829702268907535632016-04-11T16:57:42.727-04:002016-04-11T16:57:42.727-04:00Thanks for this.
I am still unsure about one thi...Thanks for this. <br /><br />I am still unsure about one thing though: How does one interpret the rates in the Independent & Dependent model rate matrices? What are the units? Do the cells contain the expected number of substitutions per tree? or per tree height? ... Or is it more complicated than that?<br /><br />Thank you!Anonymoushttps://www.blogger.com/profile/04632917697970136421noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-55257071148208181812015-12-13T05:58:04.080-05:002015-12-13T05:58:04.080-05:00great post! I'm new to the field and this real...great post! I'm new to the field and this really helps getting some orientationiyar linhttps://www.blogger.com/profile/12526030289344935276noreply@blogger.com