Difference between revisions of "R Hackathon 1/PGLS"

From Phyloinformatics
Jump to: navigation, search
Line 3: Line 3:
 
PGLS is a powerful method for analyzing continuous data that has been applied to estimating adaptive optima (Butler and King 2004) and estimating the relationships among traits (e.g., body size and geographic range size in carnivores).  PGLS allows the user to specify different ways in which the tree structure is expected to affect the covariance in trait values across taxa.  For example, the user might assume that the trait evolves by Brownian motion and thus that the trait covariance between any pair of taxa decreases linearly with the time (in branch length) since their divergence.  Alternately, the user might apply a Ornstein-Uhlenbeck model where the expected covariance decreases exponentially, as governed by the parameter alpha (Martins and Hansen 1997).    These methods are implemented in the ape package.
 
PGLS is a powerful method for analyzing continuous data that has been applied to estimating adaptive optima (Butler and King 2004) and estimating the relationships among traits (e.g., body size and geographic range size in carnivores).  PGLS allows the user to specify different ways in which the tree structure is expected to affect the covariance in trait values across taxa.  For example, the user might assume that the trait evolves by Brownian motion and thus that the trait covariance between any pair of taxa decreases linearly with the time (in branch length) since their divergence.  Alternately, the user might apply a Ornstein-Uhlenbeck model where the expected covariance decreases exponentially, as governed by the parameter alpha (Martins and Hansen 1997).    These methods are implemented in the ape package.
  
Let's return to the Geospiza dataset (within the geiger package) to try PGLS.  We assume that you have already loaded the necessary packages (geiger for the data and ape for the function) as described on this page. First load the data:
+
Let's return to the Geospiza dataset (within the geiger package) to try PGLS.  We assume that you have already loaded the necessary packages (geiger for the data and ape for the function) as described on [https://www.nescent.org/wg_phyloinformatics/R_Hackathon/TransitionProbability this page]. First load the data:
  
 
library(geiger)
 
library(geiger)

Revision as of 12:57, 13 December 2007

Phylogenetic Generalized Least Squares

PGLS is a powerful method for analyzing continuous data that has been applied to estimating adaptive optima (Butler and King 2004) and estimating the relationships among traits (e.g., body size and geographic range size in carnivores). PGLS allows the user to specify different ways in which the tree structure is expected to affect the covariance in trait values across taxa. For example, the user might assume that the trait evolves by Brownian motion and thus that the trait covariance between any pair of taxa decreases linearly with the time (in branch length) since their divergence. Alternately, the user might apply a Ornstein-Uhlenbeck model where the expected covariance decreases exponentially, as governed by the parameter alpha (Martins and Hansen 1997). These methods are implemented in the ape package.

Let's return to the Geospiza dataset (within the geiger package) to try PGLS. We assume that you have already loaded the necessary packages (geiger for the data and ape for the function) as described on this page. First load the data:

library(geiger)