pic                   package:ape                   R Documentation

_P_h_y_l_o_g_e_n_e_t_i_c_a_l_l_y _I_n_d_e_p_e_n_d_e_n_t _C_o_n_t_r_a_s_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute the phylogenetically independent contrasts using the
     method described by Felsenstein (1985).

_U_s_a_g_e:

     pic(x, phy, scaled = TRUE, var.contrasts = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector.

     phy: an object of class '"phylo"'.

  scaled: logical, indicates whether the contrasts should be scaled
          with their expected variance (default to 'TRUE').

var.contrasts: logical, indicates whether the expected variance of the
          contrasts should be returned (default to 'FALSE').

_D_e_t_a_i_l_s:

     If 'x' has names, its values are matched to the tip labels of
     'phy', otherwise its values are taken to be in the same order than
     the tip labels of 'phy'.

     The user must be careful here since the function requires that
     both series of names perfectly match, so this operation may fail
     if there is a typing or syntax error. If both series of names do
     not match, the values in the 'x' are taken to be in the same order
     than the tip labels of 'phy', and a warning message is issued.

_V_a_l_u_e:

     either a vector of phylogenetically independent contrasts (if
     'var.contrasts = FALSE'), or a two-column matrix with the
     phylogenetically independent contrasts in the first column and
     their expected variance in the second column (if 'var.contrasts =
     TRUE').

_A_u_t_h_o_r(_s):

     Emmanuel Paradis paradis@isem.univ-montp2.fr

_R_e_f_e_r_e_n_c_e_s:

     Felsenstein, J. (1985) Phylogenies and the comparative method.
     _American Naturalist_, *125*, 1-15.

_S_e_e _A_l_s_o:

     'read.tree', 'compar.gee', 'compar.lynch'

_E_x_a_m_p_l_e_s:

     ### The example in Phylip 3.5c (originally from Lynch 1991)
     cat("((((Homo:0.21,Pongo:0.21):0.28,",
        "Macaca:0.49):0.13,Ateles:0.62):0.38,Galago:1.00);",
        file = "ex.tre", sep = "\n")
     tree.primates <- read.tree("ex.tre")
     X <- c(4.09434, 3.61092, 2.37024, 2.02815, -1.46968)
     Y <- c(4.74493, 3.33220, 3.36730, 2.89037, 2.30259)
     names(X) <- names(Y) <- c("Homo", "Pongo", "Macaca", "Ateles", "Galago")
     pic.X <- pic(X, tree.primates)
     pic.Y <- pic(Y, tree.primates)
     cor.test(pic.X, pic.Y)
     lm(pic.Y ~ pic.X - 1) # both regressions
     lm(pic.X ~ pic.Y - 1) # through the origin
     unlink("ex.tre") # delete the file "ex.tre"

