[R-sig-phylo] phylo to dendrogram

2011-07-25 Thread Jarrod Hadfield
ro branch lengths, but this does not seem to work either. Any help would be gratefully received. Jarrod Hadfield -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. ___ R-sig-phylo mailing list

Re: [R-sig-phylo] phylo to dendrogram

2011-07-26 Thread Jarrod Hadfield
2di(host.tree))) as.dendrogram(h.d) Maybe it works. Regards, Klaus On 7/25/11, Jarrod Hadfield wrote: Dear list, I'm trying to convert a phylo object into a dendrogram object with little success. host.tree is a rooted ultrametric tree with polytomies stored as phylo object. The polytomie

[R-sig-phylo] parafit

2012-03-13 Thread Jarrod Hadfield
Hello Everyone, I am fitting mixed models in which I have two phylogenies and I would like to understand them in the context of earlier work. In parafit (Legndre 2002) principal coordinates of the distance matrices (J-P) are used, where J is a matrix of ones and P the phylogenetic correlation matr

Re: [R-sig-phylo] parafit

2012-03-14 Thread Jarrod Hadfield
Hi Juan, Thank you for your answer - this makes sense to me. However, could the same not be said for the unormalised eigenvectors of A as they preserve the original similarities among the taxa, have the same units etc.? Also, since solve(A) has the same eigenvectors as A but with reciprocal eigenv

Re: [R-sig-phylo] multivariate phylogenetic signal

2012-04-05 Thread Jarrod Hadfield
Hi, asreml (which is now free for academic users on windows I think) and MCMCglmm can fit this type of model. For exampl a two trait model with y1 and y2: Ainv<-inverseA(tree)$Ainv m1<-MCMCglmm(cbind(y1, y2)~trait, random=~us(trait):species, rcov=~us(trait):units, ginverse=list(species=

Re: [R-sig-phylo] phylogenetic categorical model with MCMCglmm

2012-04-20 Thread Jarrod Hadfield
Hi, The warning: 1: glm.fit: algorithm did not converge is from a standard glm that MCMCglmm uses to obtain semi-reasonable starting values. For a three (I think this is correct for your data?) category response the starting values are obtained from 2 binomial glms (the presence of catego

[R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
Hi, I have been helping someone with some analyses and came across some routines to estimate asymmetric transition rates between discrete characters. This surprised me because its fairly straightforward to prove that asymmetric transition rates cannot be identified using data collected on

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
(m1, m2) # asymmetric evolutionary transition rates strongly supported y<-rbinom(n, 1, 0.5) # random data unconnected to the tree but p=0.5 m1<-ace(y, tree, type = "d", model="SYM") m2<-ace(y, tree, type = "d", model="ARD") anova(m1, m2) #

Re: [R-sig-phylo] asymmetric transitions

2012-08-16 Thread Jarrod Hadfield
would be happy to know what others think. Cheers, ~Dan On Aug 16, 2012, at 10:09 AM, Jarrod Hadfield wrote: > Hi, > > I have had a few replies off-list which have made me try and clarify what I mean. I think the distinction needs to be made between two types of probability: the prob

Re: [R-sig-phylo] asymmetric transitions

2012-08-17 Thread Jarrod Hadfield
Hi, Thanks for the Allman & Rhodes paper, it is very nice. For me at least it confirms my suspicions, but made me realise that claims of asymmetric transition rates are only suspicious if you are unprepared to make some (strong?) assumptions. If anyone disagrees with what I have written b

Re: [R-sig-phylo] asymmetric transitions

2012-08-17 Thread Jarrod Hadfield
gh error rates. Mark, thanks for pointing out the relationship between the threshold model and the single-site covarion model. Cheers, ~Dan On Aug 17, 2012, at 6:31 AM, Jarrod Hadfield wrote: Hi, Thanks for the Allman & Rhodes paper, it is very nice. For me at least it conf

Re: [R-sig-phylo] testing binomial characters

2012-08-30 Thread Jarrod Hadfield
Hi, Regarding the blog and the feasibility of MCMCglmm for threshold models: If y1 is binary and y2 is normal, then the univariate analysis would be: Ainv<-inverseA(tree)$Ainv m1<-MCMCglmm(y1~y2, random=~species,ginverse=list(species=Ainv), data=my.data, prior=my.prior, family="ordinal") f

Re: [R-sig-phylo] specifying priors in MCMCglmm - phylogenetic logistic regression

2012-10-03 Thread Jarrod Hadfield
Hi, Quoting Margaret Evans on Mon, 24 Sep 2012 22:56:48 +0100 (BST): Hello all, I have a few questions concerning the specification of flat priors (on the probability scale) for a phylogenetic logistic regression in MCMCglmm. 1) First, I'd like to verify my understanding of the defau

Re: [R-sig-phylo] Phylogenetic signal and PGLS

2012-11-29 Thread Jarrod Hadfield
Hi, ASReml is another option, which uses REML. It takes 1/10th of a second on a 1000 tip phylogeny and is considerably more flexible. fit<-asreml(y~x,random=~giv(species),data=dat,ginverse=list(species=sm2asreml(Ainv))) # with the data set up as: ntips<-1000 tree<-rcoal(ntips) # si

Re: [R-sig-phylo] MCMCglmm: G-structure & R-Structure

2012-12-17 Thread Jarrod Hadfield
Hi Sam, The terminology G and R structure is used widely, for example in ASreml & SAS and probably others. The G-structure is the covariance matrix of the random effects and the R-structure is the covariance matrix of the residuals. In your model you have one random term (animal) and one

Re: [R-sig-phylo] MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-02 Thread Jarrod Hadfield
Hi Sereina, You should not get that error message when you do not specify a prior - but if you do can you let me know. For the prior you specified you get the error message because us(trait):units is specifying a 3x3 covariance matrix, and yet your prior, R=list(V=1,nu=0.002), is specifyi

Re: [R-sig-phylo] WG: Re: Aw: Re: MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-02 Thread Jarrod Hadfield
nits etc. Cheers, Jarrod Quoting "sereina.graber" on Fri, 02 Aug 2013 12:54:00 +0200: Ursprüngliche Nachricht Betreff: Re: Aw: Re: [R-sig-phylo] MCMCglmm for categorical data with more than 2 levels - prior specification? Von: Jarrod Hadfield An: Sereina

Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-02 Thread Jarrod Hadfield
2:binary2 -9.59263 -16.21345 -3.889063.403 <0.001 *** traitnominal.3:binary2 13.37745 9.26769 19.930644.247 <0.001 *** traitnominal.4:binary2 8.61585 3.82747 15.541713.446 <0.001 *** --- Best & thank you so much for your help! GESENDET: Freitag, 02. August 20

Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-08 Thread Jarrod Hadfield
: "Jarrod Hadfield" AN: "Sereina Graber" CC: r-sig-phylo@r-project.org BETREFF: Re: Aw: Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification? Hi, They are the effect of the covariates on the probability of being in the cat

Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification?

2013-08-08 Thread Jarrod Hadfield
? I didn`t find it... GESENDET: Donnerstag, 08. August 2013 um 15:36 Uhr VON: "Jarrod Hadfield" AN: "Sereina Graber" CC: r-sig-phylo@r-project.org BETREFF: Re: Aw: Re: Re: [R-sig-phylo] WG: Re: Re: MCMCglmm for categorical data with more than 2 levels - prior specification? H

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-21 Thread Jarrod Hadfield
Dear Gustaf, How many levels of `habitat' are there, and are they cross-classified with respect to species (i.e. are multiple species measured in the same habitat)? Assuming for now there are a reasonable number of habitats then the simplest model (without cross-classification) in asreml/

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-21 Thread Jarrod Hadfield
z package which looks promising. Cheers Gustaf On 2015-01-21 16:26, Jarrod Hadfield wrote: Dear Gustaf, How many levels of `habitat' are there, and are they cross-classified with respect to species (i.e. are multiple species measured in the same habitat)? Assuming for now there

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-22 Thread Jarrod Hadfield
ution to the pattern we observe: Va / (Va+Vhab+Ve) #phylo Vhab / (Va+Vhab+Ve) #habitat Ve / (Va+Vhab+Ve) #measurement/plasticity/local adaption and other processes Did I get that right or am I lost? Gustaf On 2015-01-22 04:54, Jarrod Hadfield wrote: Hi Gustaf, 1/ You can ignore n

Re: [R-sig-phylo] Partitioning phylogentic and environment effect on trait distribution

2015-01-22 Thread Jarrod Hadfield
n. This should be easier for a continuous predictor, right? Cheers Gustaf On 2015-01-22 12:23, Jarrod Hadfield wrote: Hi Gustaf, In the model with just species the residual variation is measurement error/plasticity error, but could also include deviations from the assumed BM process. If

Re: [R-sig-phylo] A perfect storm: phylogenetic trees, random effects and zero-inflated binomial data

2015-10-14 Thread Jarrod Hadfield
Dear Diederik, The lack of convergence is because the residual variance is non-identifiable with binary data but you have a very weak prior on it. You should fix the residual variance at something (I usually use 1): prior.test<-list(R=list(V=1,fix=1), G=list(G1=list(V=1, nu=0.002),G2 = li

Re: [R-sig-phylo] Accounting for phylogeny in binary predictor, binary response data

2016-02-11 Thread Jarrod Hadfield
problem may derive from your specification of the priors. Usually you don’t specify the prior for B in MCMCglmm. The problem may also be related to the size of your dataset. Estimation of effects can be difficult with binary data, when the dataset is small. Below is a small example from Jarrod Ha

[R-sig-phylo] root in mvOU

2016-03-03 Thread Jarrod Hadfield
Hi, I am unclear what assumptions are being made about the root values in mvOU, and was wondering if someone could clarify? For ease, imagine an OU1 model where there is one optimum per trait and so theta is a vector. Is the root value assumed to be theta, or a draw from a multivariate normal

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
Hi Chris, I think ngen in threshbayes is not the number of full iterations (i.e. a full update of all parameters), but the number of full iterations multiplied by the number of nodes (2n-1). With n=600 species this means threshbayes has only really done about 8,000 iterations (i.e. about 1000

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
pl=TRUE, family="threshold") an send me the summary and hist(dep2$Liab) Cheers, Jarrod On 16/12/2016 07:02, Jarrod Hadfield wrote: Hi Chris, I think ngen in threshbayes is not the number of full iterations (i.e. a full update of all parameters), but the number of full

Re: [R-sig-phylo] Threshold models using threshBayes vs MCMCglmmRAM

2016-12-15 Thread Jarrod Hadfield
data=traits, prior=prior.dep2, pr=TRUE, pl=TRUE, family="threshold") an send me the summary and hist(dep2$Liab) Cheers, Jarrod On 16/12/2016 07:02, Jarrod Hadf

Re: [R-sig-phylo] [R-sig-ME] Phylogenetic meta-analysis and setting animal variable in MCMCglmm

2009-09-18 Thread Jarrod Hadfield
Dear Wayne, This is my fault. With phylogenies the ancestral nodes are treated as missing data and so I set their measurement error to an arbitrary value. The code for working out how many "new" measurement errors there are was incorrect. L98 of MCMCglmm.R should read mev<-c(mev, rep(1,

Re: [R-sig-phylo] How to incorporate intraspecific variation in MCMCglmm

2017-07-14 Thread Jarrod Hadfield
Hi Diogo, First, your model1 is unlikely to be valid unless the residual variance happens to be 1. You should not fix it at one, and use a prior like: prior = list(R = list(V = 1, nu = 0.02), G=list(G1=list(V=1, nu=0.02))) Note that the residual variance (Ve) is the intra-specific variance,

Re: [R-sig-phylo] How to incorporate intraspecific variation in MCMCglmm

2017-07-17 Thread Jarrod Hadfield
Jarrod, Thanks very much for the quick reply. I'll try to implement the changes in the model. Have a nice weekend, Diogo Em Sex, 14 de jul de 2017 17:48, Jarrod Hadfield mailto:j.hadfi...@ed.ac.uk>> escreveu: Hi Diogo, First, your model1

Re: [R-sig-phylo] selecting a set of incongruent trees from a posterior distribution

2017-07-26 Thread Jarrod Hadfield
Hi Jesse, In order to account for phylogenetic uncertainty you are better just pulling trees from their posterior rather than choosing trees that are incongruent. The latter will give estimates biased toward those associated with extreme trees. If the analysis is the binomial model you poste

Re: [R-sig-phylo] Comparing DIC of phylogenetic and non-phylogenetic GLMM run with MCMC (MCMCglmm)

2018-06-21 Thread Jarrod Hadfield
Hi Liam, In multi-level models DIC can be 'focused' at different levels. In MCMCglmm, DIC is focussed at the highest possible level because this is the only level at which it can be analytically computed for non-Gaussian models. The highest level is not the level at which most scientists want

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
Hi David, It looks like phylo_ultra might be a list? Is phylo_ultra[[1]] a tree? Also, don't use nodes="TIPS"; this is just to demonstrate how poor the algorithm is when you don't use the expanded inverse. I see people using nodes="TIPS" a lot - where does this code come from? Cheers, Jarrod

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
ysiology Muséum National d'Histoire Naturelle, CNRS 7 rue Cuvier 75005 Paris, France Tel.: +33.(0)1.40.79.53.74 Associate Editor Functional Ecology http://davidcostantini.wordpress.com/ https://twitter.com/DavidZool http://scholar.google.com/citations?user=nBSC4-EJ&hl=it - Original Me

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-17 Thread Jarrod Hadfield
al Ecology http://davidcostantini.wordpress.com/ https://twitter.com/DavidZool http://scholar.google.com/citations?user=nBSC4-EJ&hl=it - Original Message - From: "Jarrod Hadfield" To: "David COSTANTINI" Cc: "r-sig-phylo" Sent: Monday, 17 May, 2021 21:34:34 Subject: R

Re: [R-sig-phylo] phylogenetic correction and MCMC model

2021-05-20 Thread Jarrod Hadfield
/DavidZool http://scholar.google.com/citations?user=nBSC4-EJ&hl=it - Original Message - From: "Jarrod Hadfield" To: "David COSTANTINI" Cc: "r-sig-phylo" Sent: Monday, 17 May, 2021 21:34:34 Subject: Re: [R-sig-phylo] phylogenetic correction and MCMC model Hi, chr