Re: [R-sig-phylo] Cophenetic repeats
Hi Ben, Just to follow up - if your tree is ultrametric then any pair of tips which span the root will have the same distance (which will be equal to twice the total depth of the tree). Other nodes in the tree will also create equal distances in the same way, but for a reasonably balanced tree pairs spanning the root will make up the largest set of identical distances. Rob On 28 May 2012 01:41, Klaus Schliep klaus.schl...@gmail.com wrote: Hello Ben, is your tree ultrametric? Do you have a e.g. UPGMA tree? This would explain your observation. You can test your tree with is.ultrametric(trx). Regards, Klaus On 5/27/12, Ben Weinstein bwein...@life.bio.sunysb.edu wrote: Hi all, I'm trying to decide if this an R error, or an error in how I've implemented branch lengths. When i create the cophenetic matrix for my tree, and look at the relatedness of all tips to a single tip (i.e just looking at one column in the matrix). I find that a large portion of them have identical cophenetic distances. I thought the cophenetic would be the sum of the branch length between tips (patristic distance), therefore there should only be pairs (sister species have equal terminal branch length) with *exactly * the same value. Comparisons from distantly related taxa should be similar, since most of the distance is dictated by the internal branches, but the terminal branch should atleast create some difference. Sorry that i can't really create a reproducible example for the question. Here is some documentation: trx-read.nexus(ColombiaPhylogenyUM.tre) seeds-sample(trx$tip.label,1) sp.weight.alpha-cophenetic(trx)[,seeds] table(sp.weight.alpha)sp.weight.alpha 0 0.00775074 0.1179723 0.2187406 0.2379734 0.23797341 0.2525792 1 1 2 4 3 2 6 0.36612256 0.36612257 0.52326843 0.59034104 0.59034105 0.59034106 0.607038 2 2 2 31 82 29 3 82 of the species have the exact same distance to my selected tip .59034105 Am i using this function correctly? I appreciate the help, Ben Weinstein -- Ben Weinstein Graduate Student Ecology and Evolution Stony Brook University http://life.bio.sunysb.edu/~bweinste/index.html [[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 -- Rob Lanfear Research Fellow, Ecology, Evolution, and Genetics, Research School of Biology, Australian National University Tel: +61 2 6125 4321 www.robertlanfear.com [[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] mccr test for non ultrametric trees
Hi all, I would enquire the list about a simple issue. Is there any method implemented to test for changes in diversification rate as applied to fossil (non- ultrametric) trees?. As far as I understand, the methods so far available work on ultrametric trees (I've inspected laser's mccrTest.Rd, and Cusimano's et al. CorSiM). I'm tempted to say that an easy workaround would be to get the real age of nodes by substituting the function branching.times with an an hoc script where needed, and then simulate trees of the same size as the orginal (e.g. with TreeSim functions) to get the null distribution of gamma values. Is that feasible? thanks, Pas ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
[R-sig-phylo] Non-parametric alternative to phylogenetic ANOVA?
Dear all I'm trying to compare one trait across three (unordered categorical) groups including 25 species (let's say for example basal metabolic rate of aquatic, terrestrial and aerial mammals). If the data would be normally distributed, I would simply use a phylogenetic ANOVA including a post-hoc test on means accounting for the phylogeny, as provided by the package phytools. However, my tip-data are far away from being normally distributed, and transformations only lead to unsatisfying improvements (e.g Shapiro-Wilk test returns a p-Value of 0.08 instead of 0.03 as before transformation). So I am not convinced that a phylogenetic ANOVA is the right approach for dealing with these sort of data. Is there any non-parametric approach to compare groups across phylogeny that also returns which groups differ from each other? Your sincerely, Karin [[alternative HTML version deleted]] ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Re: [R-sig-phylo] Non-parametric alternative to phylogenetic ANOVA?
Hi Karin. GLS with x as a factor is a generalized ANOVA which assumes [in the case of gls(...,correlation=corBrownian)] that the residual error in the ANOVA model has evolved by Brownian evolution. If you read your data into data frame Z with row names as species names, for instance: Z-read.table(filename,header=T,row.names=1) tree-read.tree(treefile) and your column name for the factor is x the column name for the continuous response variable is y, then you should just be able to do: fit-gls(y~x,data=Z,correlation=corBrownian(1,tree)) You can then perform various posthoc analyses from the gls object that is produced. For instance summary(fit) anova(fit) residuals(fit) As pointed out by Alejandro, you should check for normality of the residuals in residuals(fit) - not the normality of y before analysis. summary(fit) will also give you parameter estimated (fitted means for each factor) and standard errors. These can be used to conduct posthoc comparison of means using t-tests in the standard way. I hope this helps. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 5/30/2012 10:46 AM, Karin Schneeberger wrote: Hi Alejandro Thank you for the very quick answer. I tried PGLS before, but then was told that GLS is not suitable for multistate categorical variables that can not be ranked (otherwise I would treat them as continuous). Also, with GLS it's as far as I understood not possible to state statistically whether certain groups are greater than others. But I am new into this kind of analysis and am very happy for any help and explanation, as I might be totally wrong. Cheers, Karin Von: Alejandro Gonzalezalejandro.gonza...@ebd.csic.es CC: r-sig-phylo@r-project.orgr-sig-phylo@r-project.org Gesendet: 16:26 Mittwoch, 30.Mai 2012 Betreff: Re: [R-sig-phylo] Non-parametric alternative to phylogenetic ANOVA? Hi Karin, You could use a gls method and look at the distribution of your residuals. It is the residuals which must be normally distributed, which can be checked using diagnostic plots such as a histogram or qq-plot of the residuals of your model. Cheers Alejandro On 30, May 2012, at 4:12 PM, Karin Schneeberger wrote: Dear all I'm trying to compare one trait across three (unordered categorical) groups including 25 species (let's say for example basal metabolic rate of aquatic, terrestrial and aerial mammals). If the data would be normally distributed, I would simply use a phylogenetic ANOVA including a post-hoc test on means accounting for the phylogeny, as provided by the package phytools. However, my tip-data are far away from being normally distributed, and transformations only lead to unsatisfying improvements (e.g Shapiro-Wilk test returns a p-Value of 0.08 instead of 0.03 as before transformation). So I am not convinced that a phylogenetic ANOVA is the right approach for dealing with these sort of data. Is there any non-parametric approach to compare groups across phylogeny that also returns which groups differ from each other? Your sincerely, Karin [[alternative HTML version deleted]] ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo __ Alejandro Gonzalez Voyer Post-doc Estación Biológica de Doñana Consejo Superior de Investigaciones Científicas (CSIC) Av Américo Vespucio s/n 41092 Sevilla Spain Tel: + 34 - 954 466700, ext 1749 E-mail: alejandro.gonza...@ebd.csic.es Web site (Under construction): Personal page: http://consevol.org/members/alejandro.html Group page: http://consevol.org/index.html For PDF copies of papers see: http://csic.academia.edu/AlejandroGonzalezVoyer [[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
Re: [R-sig-phylo] mccr test for non ultrametric trees
Pasquale- This isn't a feasible solution, because the branch lengths of a paleo-tree are a function of birth, death and sampling rates. I'll be discussing work that Matt Pennell, Emily King and I have been doing relating to this issue next month at Evolution. -Dave On Wed, May 30, 2012 at 8:23 AM, pasquale.r...@libero.it pasquale.r...@libero.it wrote: Hi all, I would enquire the list about a simple issue. Is there any method implemented to test for changes in diversification rate as applied to fossil (non- ultrametric) trees?. As far as I understand, the methods so far available work on ultrametric trees (I've inspected laser's mccrTest.Rd, and Cusimano's et al. CorSiM). I'm tempted to say that an easy workaround would be to get the real age of nodes by substituting the function branching.times with an an hoc script where needed, and then simulate trees of the same size as the orginal (e.g. with TreeSim functions) to get the null distribution of gamma values. Is that feasible? thanks, Pas ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo -- David Bapst Dept of Geophysical Sciences University of Chicago 5734 S. Ellis Chicago, IL 60637 http://home.uchicago.edu/~dwbapst/ http://cran.r-project.org/web/packages/paleotree/index.html ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
[R-sig-phylo] brunch
Hello, I have been trying to figure out a few details in the caper functions brunch and crunch. Say I want to run PIC for Y as a function of X (as seen in Garland and Ives 2000), my understanding is I would have to find the IC's for Y and X independently and apply the regression formulas. What kinds of models can I use in crunch? Can I do Y as a function of X1 and X2, all of the variables being continuous? Are the contrasts for each variable computed independently or simultaneously? Does brunch only let me use Y as a function of one binary trait? Does it allow Y to be a function of one continuous trait and on binary trait? Thanks! Yanthe E. Pearson Postdoctoral Researcher Dept. of Biology, Fagan Lab University of Maryland College Park Email: ypear...@umd.edu ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Re: [R-sig-phylo] brunch
Hi Yanthe, It's been a while since I've used these functions, but if I remember correctly, you can do what you ask with crunch but not brunch. What kinds of models can I use in crunch? Can I do Y as a function of X1 and X2, all of the variables being continuous? Are the contrasts for each variable computed independently or simultaneously? crunch computes a linear model using phylogenetically independent contrasts of continuous variables, so you can do PIC(Y)~PIC(X), or PIC(Y)~PIC(X1)+PIC(X2) etc. This would be equivalent to using PGLS with Y and X. I think for the crunch algorithm in caper, you pass it the data rather than the contrasts, but this could be done by hand. Does brunch only let me use Y as a function of one binary trait? Does it allow Y to be a function of one continuous trait and on binary trait? Brunch, on the other hand, is using an algorithm described by Felsenstein (1985, apparently suggested to him by an un-named graduate student) where independent contrasts are computed between pairs of taxa that differ in values of a discrete trait (and in the same direction (i.e. state 1 - state 2 in all cases). Such contrasts are only truly independent if lines drawn along branches between pairs of taxa do not cross. Under the null model, these contrasts are expected to be normally distributed with mean zero and a t-test or sign test can be used to test if they differ from this expectation. Because the contrasts are computed explicitly between pairs of taxa that differ in categorical group membership, you can't model Y as a function of both a discrete and continuous trait. Graham Graham Slater Department of Ecology and Evolutionary Biology University of California, Los Angeles 621 Charles E Young Drive South Los Angeles CA 90095-1606 (310) 825-4669 gsla...@ucla.edu www.eeb.ucla.edu/gslate ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo