Re: [R-sig-phylo] Dollo character using ace/make.simmap

2015-09-14 Thread Matt Pennell
Hi Graeme, I am not sure what you want to do with this but...it is straightforward to disallow reverse transitions in diversitree ## Simulate a dollo character library(diversitree) set.seed(1) t <- tree.bd(c(1,0), max.taxa=100) d <- sim.character(t, c(0.1, 0), model="mk2") ## make a likelihood

Re: [R-sig-phylo] Prune very large tree

2015-07-15 Thread Matt Pennell
Hi Sergio, The simplest way to do this in R is just to set the rownames of your data frame to be the species names and use library(geiger) res - treedata(your_tree, your_data) pruned_tree - res$phy This is going to be a bit slow but shouldn't be too bad if you are only doing it a few times.

Re: [R-sig-phylo] Standalone version of AWTY

2015-06-15 Thread Matt Pennell
Hi, There is a new R implementation of AWTY https://github.com/danlwarren/RWTY Haven't used it myself but I think this will probably alleviate this issue. Cheers, Matt On Mon, Jun 15, 2015 at 7:43 AM, Daniel Fulop dfulop@gmail.com wrote: What about using Tracer instead? It's

Re: [R-sig-phylo] AIC scores to compare pGLS and pRMA regressions

2014-10-03 Thread Matt Pennell
Hi Ashley, I think that these two types of analyses are actually asking different things and therefore the decision of which type of analysis is best should be made on biological rather than statistical grounds (i.e., no point in comparing likelihoods or AIC scores). There is a good (albeit,

[R-sig-phylo] Concentrated changes test

2014-05-16 Thread Matt Pennell
Hi everyone, Just a quick question: I was wondering if there is a R implementation of Wayne Maddison's (1990) concentrated changes test ( http://www.jstor.org/stable/2409434). After a little looking around, I can't seem to find it but was hoping someone else might have some ideas. Thanks in

Re: [R-sig-phylo] How can lambda be low in a pGLS ancova and also high for the variables involved.

2014-01-22 Thread Matt Pennell
Agus, The reason is that in PGLS, the model (here, Pagel's lambda) is used to describe the covariance of the residuals, not of the actual data. In your cause, it appears that while there is a lot of information in the phylogeny regarding the traits themselves, that the phylogeny is not that

Re: [R-sig-phylo] Sampling bias in discrete trait estimation

2013-11-11 Thread Matt Pennell
Hi Luiz, Yes, non-random sampling of traits, if not taken into account will certainly bias the estimation of the transition parameters. Methods for addressing this have been developed by Rich FitzJohn and colleagues http://sysbio.oxfordjournals.org/content/58/6/595.short (this was discussed in

Re: [R-sig-phylo] Identical likelihood values for OU and EB models

2013-10-17 Thread Matt Pennell
So the reason for this is that the default bounds for the EB model in the CRAN version of geiger allows the a parameter to be both positive and negative (i.e. the ACDC model of Blomberg et al. 2003), such that the rates of trait evolution can either increase or decrease. What is happening is that

Re: [R-sig-phylo] Lambda; PIC vs. PGLS

2013-06-11 Thread Matt Pennell
Hi Megan, This looks to me like the problems are arising because the optimal value of lambda is negative (and you are running into optimization problems by bounding it at zero). This is a bit strange -- but not unheard of, I have seen similar results before. What it implies that the trait values

Re: [R-sig-phylo] testing for correlates of rates of evolution

2013-03-11 Thread Matt Pennell
John, This is a tricky question. If your independent variables were discrete, you could use a stochastic character mapping approach to map state regimes onto your tree and ask whether the regimes had different rates using a model selection approach. (This could be done with the R packages

Re: [R-sig-phylo] prune phylogeny and PGLS

2012-10-23 Thread Matt Pennell
hi all, you can use pgls using something like this require(ape) require(geiger) require(nlme) tree - read.tree(filename.tre) data - read.csv(dataset.csv) ## make the row names of the dataset equal to the species names ## say one of the columns in your dataset is labeled species

Re: [R-sig-phylo] variation in rates over time

2012-09-17 Thread Matt Pennell
Jason, I think the best way to do this is with the approach of O'Meara et al. 2006 Evolution Brownie. Liam Revell has implemented this in R in his package phytools. You can modify the steps taken in this tutorial here http://phytools.blogspot.com/2011/07/running-brownielite-for-arbitrarily.html

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Matt Pennell
Jarrod and Dan, While I see what Dan is saying and I agree that evaluating this with non-phylogenetic data is not entirely useful, I think you have stumbled upon a known issue but one that is not widely appreciated. While the MK model is a useful model for discrete characters in many ways, it

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Matt Pennell
Hey all, This has been a really fantastic discussion. Mark, you make some really excellent points in response to my earlier comments. I think you are correct in this. The question that arises out of Jarrod and Dan's simulations (which I have just run) is whether a model selection criteria would

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Matt Pennell
correction: the last sentence should have read I wonder how that would work in this case. I think these are important questions going forward. On Thu, Aug 16, 2012 at 11:00 PM, Matt Pennell mwpenn...@gmail.com wrote: Hey all, This has been a really fantastic discussion. Mark, you make some

Re: [R-sig-phylo] Within-species error in PGLS (or similar)

2012-07-16 Thread Matt Pennell
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

[R-sig-phylo] What percentage of plants are woody?

2012-06-03 Thread Matt Pennell
Hi all, This is perhaps an unconventional use of the r-sig-phylo mailing list. Rather than asking for advice on how to do an analysis, I am enlisting the expertise of the community to try and actually help do the analysis. If you have a few seconds, I would really appreciate it if you could help

Re: [R-sig-phylo] birthdeath {ape} fails every time.

2012-04-20 Thread Matt Pennell
Hi all, Just a note on this topic, which Rich may be able to help clarify if he sees this. It can be shown that Rich's equation which uses log(abs(...)) is exactly equivalent to the regular version of the Nee equation. However, for an ultrametric tree, the ML of lambda will always be greater than

Re: [R-sig-phylo] birthdeath {ape} fails every time.

2012-04-19 Thread Matt Pennell
Simon, For reasons that I do not fully understand, the problem arises with the use of a coalescent tree (which has a very branch length distribution than a tree generated under a birthdeath process). maybe someone else has some insight into why this causes birthdeath to fail. if you run

Re: [R-sig-phylo] error in is.monophyletic()

2012-03-22 Thread Matt Pennell
Bret, I think the reason has to do with the fact that c(2,3) is of the class numeric. It is actually not specifying the tip labels (which are characters). for example: foo = read.tree(text=((1:2.0,(2:1.**0,3:1.0):1.0):1.0,4:3.0);) class(foo$tip.label) [1] character therefore, the following

Re: [R-sig-phylo] diversitree with multicore

2012-03-21 Thread Matt Pennell
Hi all, I am not sure what type of diversitree analysis but there may be some memory issues if you use mcapply or the likes (this is especially true if using the mcmc version of QuaSSE). An alternative (albeit slightly more complicated) way of doing this is to write a bash script which utilizes

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

Re: [R-sig-phylo] Phylogenetic correlation in relative abundance data

2012-01-25 Thread Matt Pennell
Thanks to everyone for the helpful comments. Thet are very much appreciated. cheers, matt On Wed, Jan 25, 2012 at 11:40 AM, Matthew Helmus mrhel...@gmail.com wrote: Here is generalized R Code translated from what Tony wrote in Matlab for the paper. Matt Pennell please feel free to respond

Re: [R-sig-phylo] function to insert missing tips in a clade

2012-01-19 Thread Matt Pennell
Hi Robin (and others) I am not sure what sorts of analyses you plan on doing but you might want to look into some recent work by Helene Morlon and colleagues. She has recently published two different approaches (2010 Plos Biology; 2011 PNAS) to diversification rate which can fit birth-death (and

Re: [R-sig-phylo] Phylogenetic Logistic Regression

2011-11-21 Thread Matt Pennell
, 2011, at 6:21 PM, Matt Pennell wrote: Hi all, I am trying to build a phylogenetic logistic regression model in which the response variable is binary and the independent variables are a mix of both categorical and continuous variables. All of my independent variables are fixed effects. I know

[R-sig-phylo] Phylogenetic Logistic Regression

2011-11-20 Thread Matt Pennell
Hi all, I am trying to build a phylogenetic logistic regression model in which the response variable is binary and the independent variables are a mix of both categorical and continuous variables. All of my independent variables are fixed effects. I know that a method for doing this has been