Hi Karla,
Here a short simulated example of covarying traits just to illustrate the 
general workflow:  
library(mvMORPH)set.seed(14)
# Simulate a 50 tips treetree<-pbtree(n=50)# Simulate correlated body size and 
wing size traits (on empirical data you must log-transform the 
data)data<-mvSIM(tree, param=list(sigma=sigma, ntraits=2, mu=theta,             
                 names_traits=c("wing.size","body.size")), model="BM1", nsim=1)
# Fit one model with different ratesfit1<-mvBM(tree, data, model="BM1")
# Then fit one model with similar rates on both traitsfit2<-mvBM(tree, data, 
model="BM1", param=list(constraint=TRUE))
# Now compare the AICAIC(fit1)AIC(fit2)
# Or compute the LRT test to assess the significance of the 
differencesLRT(fit1,fit2)  
If the data are best fitted by another model, say for instance an 
Ornstein-Uhlenbeck, the BM rates estimates are probably not appropriate but you 
can compare the variance as Chad suggested (See for instance Hunt 
(2012)-Paleobiology for detail on this issue and Price et al. 2013- Evolution 
for en example and an other way (also based on simulations) to cope with this 
problem...)  
To compare the variance of an OU process:alpha<-matrix(c(2,0.5,0.5,1),2)
sigma<-matrix(c(0.1,0.05,0.05,0.1),2)
theta<-c(0,0)# Simulated traits under OU
data<-mvSIM(tree, param=list(sigma=sigma, alpha=alpha, ntraits=2, mu=theta,
            names_traits=c("wing.size","body.size")), model="OU1", nsim=1)
fit3<-mvBM(tree, data, model="BM1")
fit4<-mvOU(tree, data, model="OU1")
# Compare the modelsAIC(fit3)AIC(fit4)
 # Compare the variances on both traitsdiag(stationary(fit4))
To assess whether they significantly differ you can then use a parametric 
bootstrap approach by simulating the traits under the maximum likelihood 
estimates:
# 100 simulated datasetssimul<-simulate(fit4,tree=tree,nsim=100)
# Then, fit and extract the diagonal elements of the stationary OU covariance 
matrix... and so on... (wait few minutes)results<-sapply(1:100, function(x){ 
diag(stationary(mvOU(tree, simul[[x]], model="OU1", method="sparse", 
echo=FALSE, diagnostic=FALSE))) })
# compare the estimated OU variance...boxplot(t(results), main="traits 
variance")
HTH,
Julien



> From: [email protected]
> To: [email protected]; [email protected]
> Date: Fri, 17 Jul 2015 19:19:12 +0000
> CC: [email protected]; [email protected]
> Subject: Re: [R-sig-phylo] testing for variation in rates of evolution        
> among   traits
> 
> These are very important points to consider. 
> 
> And yes, my approach does allow one to account for the covariation among 
> traits when comparing their evolutionary rates.  This is accomplished when 
> using the full evolutionary rate matrix for the test, which contains both the 
> evolutionary rates for each trait and the pairwise evolutionary correlations 
> between them. 
> 
> Dean
> 
> Dr. Dean C. Adams
> Professor
> Department of Ecology, Evolution, and Organismal Biology
>        Department of Statistics
> Iowa State University
> www.public.iastate.edu/~dcadams/
> phone: 515-294-3834
> 
> -----Original Message-----
> From: R-sig-phylo [mailto:[email protected]] On Behalf Of Joe 
> Felsenstein
> Sent: Friday, July 17, 2015 2:08 PM
> To: Giulio V. Dalla Riva <[email protected]>
> Cc: r-sig-phylo mailman <[email protected]>; Theodore Garland Jr 
> <[email protected]>
> Subject: Re: [R-sig-phylo] testing for variation in rates of evolution among 
> traits
> 
> Warning: You'd have to ensure that the traits for which you are comparing 
> rates are evolving independently, so that they do not covary in their 
> evolutionary changes.
> 
> I assume Dean Adams's paper involves some way of coping with this.  The issue 
> of log-transforms that Ted raised is very important, otherwise big 
> measurements will tend have higher rates of evolution.
> 
> Joe
> --------
> [email protected]
> 
>       [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-phylo mailing list - [email protected] 
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/[email protected]/
> 
> _______________________________________________
> R-sig-phylo mailing list - [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/[email protected]/

                                          
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to