[R-sig-phylo] Transforming data for OU model
Hi all, I am running an OU model on data that is constrained by zero (precipitation values). Therefore I thought to log transform the data. However I still have some issues with the transformation: 1. When all values in the data are larger than 1.0, the log transformation will still result in all values being positive. 2. In case I have a value of zero, log transforming it will give -Inf. I would greatly appreciate any advice regarding the best way of transforming and dealing with this kind of data. Thanks you, Anna [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Transforming data for OU model
Given the nature of precipitation data, I don't think a log transform makes sense biologically. It is very different from, say, body mass. I think you need to simulate with limits, as described originally here: Garland, T., Jr., A. W. Dickerman, C. M. Janis, and J. A. Jones. 1993. Phylogenetic analysis of covariance by computer simulation. Systematic Biology 42:265-292. Limits can be implemented with or without other things, such as OU and/or a trend. Our programs are in DOS (What's DOS? The last operating system that worked ...). However, I think you can also do this in R somewhere, maybe phytools? Liam Revell, want to jump in here? Happy thanksgiving, Ted Theodore Garland, Jr., Professor Department of Biology University of California, Riverside Riverside, CA 92521 Office Phone: (951) 827-3524 Wet Lab Phone: (951) 827-5724 Dry Lab Phone: (951) 827-4026 Home Phone: (951) 328-0820 Skype: theodoregarland Facsimile: (951) 827-4286 = Dept. office (not confidential) Email: tgarl...@ucr.edu http://www.biology.ucr.edu/people/faculty/Garland.html http://scholar.google.com/citations?hl=enuser=iSSbrhwJ Inquiry-based Middle School Lesson Plan: Born to Run: Artificial Selection Lab http://www.indiana.edu/~ensiweb/lessons/BornToRun.html Fail Lab: Episode One http://testtube.com/faillab/zoochosis-episode-one-evolution http://www.youtube.com/watch?v=c0msBWyTzU0 From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org] on behalf of Anna Rice [annarice...@gmail.com] Sent: Thursday, November 28, 2013 6:47 AM To: r-sig-phylo@r-project.org Subject: [R-sig-phylo] Transforming data for OU model Hi all, I am running an OU model on data that is constrained by zero (precipitation values). Therefore I thought to log transform the data. However I still have some issues with the transformation: 1. When all values in the data are larger than 1.0, the log transformation will still result in all values being positive. 2. In case I have a value of zero, log transforming it will give -Inf. I would greatly appreciate any advice regarding the best way of transforming and dealing with this kind of data. Thanks you, Anna [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Transforming data for OU model
Ted Garland wrote: Our programs are in DOS (What's DOS? The last operating system that worked ...). However, I think you can also do this in R somewhere, maybe phytools? Liam Revell, want to jump in here? Just to remind people: DOS (also called MSDOS) executables programs can be run in Windows using the Command Prompt tool, which you will find in the Accessories menu that is found in the menu opened by the All Programs tab in the Start Menu. Joe Joe Felsenstein, j...@gs.washington.edu Dept. of Genome Sciences, Univ. of Washington Box 355065, Seattle, WA 98195-5065 USA ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Transforming data for OU model
Good point, Joe. However, if they have graphics screens (as in our PDTREE.EXE and PDSIMUL.EXE) programs, then you sometimes have trouble with the display of those particular screens. Plain text screens (ASCII characters only) aren't a problem. Also, you can get idiosyncratic problem, such as a laptop that shows the graphics screen just fine, but an external monitor glitches out. Anyway, if anybody wants these classic DOS programs, just let me know! Hasta, Ted From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org] on behalf of Joe Felsenstein [j...@gs.washington.edu] Sent: Thursday, November 28, 2013 1:38 PM To: r-sig-phylo@r-project.org Mailing-list Subject: Re: [R-sig-phylo] Transforming data for OU model Ted Garland wrote: Our programs are in DOS (What's DOS? The last operating system that worked ...). However, I think you can also do this in R somewhere, maybe phytools? Liam Revell, want to jump in here? Just to remind people: DOS (also called MSDOS) executable programs can be run in Windows using the Command Prompt tool, which you will find in the Accessories menu that is found in the menu opened by the All Programs tab in the Start Menu. Joe Joe Felsenstein, j...@gs.washington.edu Dept. of Genome Sciences, Univ. of Washington Box 355065, Seattle, WA 98195-5065 USA ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Transforming data for OU model
I had been imagining that precipitation was a dependent variable, not that it matters. In any case, you have the need for a lower limit of zero and probably an upper limit that is somewhat above the greatest recorded values. I can't see why you would want an OU model for precipitation, though. As Liam wrote, we all need more info about what you are doing. And we need to get the hell off the computer on a holiday! Cheers, Ted From: Liam J. Revell [liam.rev...@umb.edu] Sent: Thursday, November 28, 2013 12:16 PM To: Theodore Garland Jr; Anna Rice; r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] Transforming data for OU model Hi Ted Anna. phytools indeed includes a function for simulating Brownian evolution within bounds. This is in the function fastBM. It is also possible to simulate with a trend in fastBM, or under OU (as of the latest non-CRAN phytools, http://www.phytools.org) - but combining a trend or bounds with OU is not permitted. One question I have is what do you mean when you are saying you are running an OU model on precipitation data? Are you fitting a linear regression using GLS with a phylogenetic error structure based on the OU model in which precipitation is a predictor? If so, then it may not matter because multivariate normality of the predictors is not, strictly speaking, an assumption of GLS. Hope that may be helpful. All the best, 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://blog.phytools.org On 11/28/2013 1:52 PM, Theodore Garland Jr wrote: Given the nature of precipitation data, I don't think a log transform makes sense biologically. It is very different from, say, body mass. I think you need to simulate with limits, as described originally here: Garland, T., Jr., A. W. Dickerman, C. M. Janis, and J. A. Jones. 1993. Phylogenetic analysis of covariance by computer simulation. Systematic Biology 42:265-292. Limits can be implemented with or without other things, such as OU and/or a trend. Our programs are in DOS (What's DOS? The last operating system that worked ...). However, I think you can also do this in R somewhere, maybe phytools? Liam Revell, want to jump in here? Happy thanksgiving, Ted Theodore Garland, Jr., Professor Department of Biology University of California, Riverside Riverside, CA 92521 Office Phone: (951) 827-3524 Wet Lab Phone: (951) 827-5724 Dry Lab Phone: (951) 827-4026 Home Phone: (951) 328-0820 Skype: theodoregarland Facsimile: (951) 827-4286 = Dept. office (not confidential) Email: tgarl...@ucr.edu http://www.biology.ucr.edu/people/faculty/Garland.html http://scholar.google.com/citations?hl=enuser=iSSbrhwJ Inquiry-based Middle School Lesson Plan: Born to Run: Artificial Selection Lab http://www.indiana.edu/~ensiweb/lessons/BornToRun.html Fail Lab: Episode One http://testtube.com/faillab/zoochosis-episode-one-evolution http://www.youtube.com/watch?v=c0msBWyTzU0 From: r-sig-phylo-boun...@r-project.org [r-sig-phylo-boun...@r-project.org] on behalf of Anna Rice [annarice...@gmail.com] Sent: Thursday, November 28, 2013 6:47 AM To: r-sig-phylo@r-project.org Subject: [R-sig-phylo] Transforming data for OU model Hi all, I am running an OU model on data that is constrained by zero (precipitation values). Therefore I thought to log transform the data. However I still have some issues with the transformation: 1. When all values in the data are larger than 1.0, the log transformation will still result in all values being positive. 2. In case I have a value of zero, log transforming it will give -Inf. I would greatly appreciate any advice regarding the best way of transforming and dealing with this kind of data. Thanks you, Anna [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/