Actually, modify my previous email. That only works for sig^2(x)=1.0. It should be:

library(phytools)
y<-r*x+sqrt(1-r^2)*fastBM(tree,sig2=mean(pic(x,tree)^2))

- Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 7/24/2012 4:47 PM, Liam J. Revell wrote:
Hi Andrew.

For desired correlation r, size data x, and tree you could just do:

library(phytools)
y<-r*x+sqrt(1-r^2)*fastBM(tree)

This should give you the correlation r on average and the y|x should be
Brownian. (If x is Brownian, then both y & x & y|x will be too.)

- Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 7/24/2012 2:25 PM, Andrew Barr wrote:
Hello everyone,

I have a tree, with body mass data for the tip taxa.  I am interested
in simulating the evolution of continuous traits by BM that are
correlated with body mass. I want to use the body mass tip data that I
have to inform the character simulation, so that my resulting
simulated tip values are highly correlated with my actual body mass
data.

Can anyone suggest an appropriate way to simulate this?  I know I can
simulate correlated characters with geiger::sim.char(), but I don't
know how I could include my actually body mass data using this method.

Thanks very much,

W. Andrew Barr
PhD Candidate
Dept of Anthropology
University of Texas at Austin
www.ancienteco.com

_______________________________________________
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

Reply via email to