Re: [R-sig-phylo] specific input on PGLS

2016-03-03 Thread Orme, David
Hi Krishna, > (1) I'd like to examine the links between group size (cont. outcome) and > various social network measures (cont. predictors) across 10 species of > nonhuman primates. I first tried implementing the PGLS code in Caper > package that incorporates random-sampling of intraspecific

Re: [R-sig-phylo] interpretation of r-squared from pgls in caper

2015-06-08 Thread Orme, David
Hi James, One key issue is that you’ve got multiple components in the GLS model - the data and the covariance matrix. If you change the covariance matrix, then changes in residuals in the model aren’t comparable. What caper does internally is to fit the intercept-only model for the data using

Re: [R-sig-phylo] Standardized regression coefficients pgls

2015-02-24 Thread Orme, David
Dear Priya, Simon Blomberg posted on this back in 2008: https://stat.ethz.ch/pipermail/r-sig-phylo/2008-June/000128.html His point is that scaling the variables before the analysis using their simple standard deviations doesn�t correctly account for the phylogenetic structure. I think there

Re: [R-sig-phylo] Simulated phylogenies with character divergence

2014-10-21 Thread Orme, David
Hi Ben, I don’t think growTree() will help, I’m afraid. You might be able to get the inheritance rules to get the model right but there isn’t a way in growTree to simulate characters along an existing tree - the traits and topology are all simulated at the same time. David On 20 Oct 2014, at

Re: [R-sig-phylo] negative lambda

2014-06-26 Thread Orme, David
Hi Luke and all, Nice explanation! Hadn’t thought it through but that makes sense that you’ll get them for species that are less similar to their sisters than you’d expect. With an edit to remove the line of code that objects to negative lambda, pgls() can estimate likelihood for negative

Re: [R-sig-phylo] degrees of freedom issue in pgls() 'caper'

2013-04-24 Thread Orme, David
Dear Xavier, Also - they're two slightly different things. The F test on pgls() does look like a bug - it isn't handling df for categorical variables correctly in calculating the F value - the previous thread is to do with treating branch length transformations as parameters. Cheers, David

Re: [R-sig-phylo] Caper pGLS interpretation: discrepancy between coefficient and model significance

2013-01-28 Thread Orme, David
Hi Adam, Thanks for the quick explanation - and you're right, there is a bug in the summary method for pgls that is improperly including the intercept in numerator degrees of freedom. I've fixed it and will roll a new caper version out onto CRAN soon. Cheers, David On 27 Jan 2013, at 15:28,

Re: [R-sig-phylo] degrees of freedom issue in pgls() 'caper'

2012-10-11 Thread Orme, David
Hi Adam, At present, branch length transformations are not treated as coefficients inside of the analysis of variance in pgls. This is something I've pondered recently so it would be good to get opinions. My brain is a bit fried this evening so I'm not going to weigh in with any actual

Re: [R-sig-phylo] Branch length transformation parameters – which one to use?

2012-07-25 Thread Orme, David
Hi, There are a couple of Pagel references that discuss the various transformations in pgls(): Pagel, M. D. Inferring the historical patterns of biological evolution. Nature 401, 877–884 (1999). Pagel, M. D. Detecting correlated evolution on phylogenies: a general method for the comparative

Re: [R-sig-phylo] Best way to summarize a tree balance statistic over a posterior tree distribution?

2012-06-15 Thread Orme, David
Hi Simon, Slightly off the top of my head, but I'd use the distribution of I' over the 1000 trees and test if it is different from the expectation of 0.5. That ignores the variation in the expectation, so simulate 1000 random trees of the same number of tips, and then do a t.test to compare

Re: [R-sig-phylo] brunch

2012-05-31 Thread Orme, David
Hi Yanthe, Just to second what Graham says - it sounds like a crunch problem. The crunch() and brunch() functions in caper do both take the raw data and then calculate contrasts in all the variables in the model simultaneously. The pic() function in the ape package does the same for one

Re: [R-sig-phylo] avPlots for PGLS?

2012-03-23 Thread Orme, David
Hi Jay, There isn't a function but you can get the plots directly from models. The avPlot function can be reproduced quite simply: library(car) mod1 - lm(prestige ~ income+education+type, data=Duncan) mod2 - lm(prestige ~ education+type, data=Duncan) mod3 - lm(income ~ education+type,

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

2012-01-19 Thread Orme, David
attached. As you can also see, PIC returns a very different result than PGLS. Many thanks, Karin Von: Orme, David d.o...@imperial.ac.ukmailto:d.o...@imperial.ac.uk An: Karin Schneeberger k.schneeber...@yahoo.demailto:k.schneeber...@yahoo.de Cc: r-sig-phylo@r

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

2012-01-15 Thread Orme, David
Dear Karin, Liam is right - this shouldn't happen unless there is a problem with optimisation. It is difficult to optimise on very flat likelihood surfaces and I've found you do sometimes get inconsistent results between different packages with lambdas close to zero. However, getting one and

Re: [R-sig-phylo] Doubts and problems (bug?) when using comparative.data and pgls functions in caper‏

2011-12-14 Thread Orme, David
Hi Edwin, That is a bug - I've fixed it in the developmental version on R-forge but haven't yet rolled out a new version to CRAN. Many thanks for reporting it! Phylogenetic independent contrasts, where comparisons need to be made between pairs of branches, require methods adjustments for

[R-sig-phylo] follow up for lambda transform - query: how to use an existing covariance matrix directly in a gls procedure in R?

2011-07-21 Thread Orme, David
Hi all, I forgot to copy my reply to Luke to the list - here's another solution in case the question crops up again. Cheers, David Begin forwarded message: Date: 20 July 2011 11:57:46 GMT+01:00 To: Luke Matthews matth...@mednetworks.commailto:matth...@mednetworks.com Subject: Re: