[R-sig-phylo] Is correlation of PICs, with tip data and each terminal node split into male and female, a valid method?

Theodore Garland Jr theodore.garland at ucr.edu
Thu Nov 3 18:22:07 CET 2011

Dear Alberto,

I agree with all of what Marguerite wrote.  Here are two good papers to check on the metrics:

Abouheif, E., and D. J. Fairbairn. 1997. A comparative analysis of allometry for sexual size dimorphism: assessing Rensch's rule. Am. Nat. 149:540-562.

Cox, R. M., S. L. Skelly, and H. B. John-Alder. 2003. A comparative test of adaptive hypotheses for sexual dimorphism in lizards. Evolution 57:1653-1669.

And, with so few species, you are not going to be able to tell very well whether a phylogenetic statistical model, using a hierarchical tree, fits your data better than a conventional analysis, assuming a star phylgony, so present both.


Theodore Garland, Jr.
Department of Biology
University of California, Riverside
Riverside, CA 92521
Office Phone:  (951) 827-3524
Home Phone:  (951) 328-0820
Facsimile:  (951) 827-4286 = Dept. office (not confidential)
Email:  tgarland at ucr.edu

Experimental Evolution: Concepts, Methods, and Applications of Selection Experiments
Edited by Theodore Garland, Jr. and Michael R. Rose
(PDFs of chapters are available from me or from the individual authors)

From: r-sig-phylo-bounces at r-project.org [r-sig-phylo-bounces at r-project.org] on behalf of Marguerite Butler [mbutler808 at gmail.com]
Sent: Thursday, November 03, 2011 9:49 AM
To: Alberto Gallano
Cc: R-phylo Mailing-list
Subject: Re: [R-sig-phylo] Is correlation of PICs,      with tip data and each terminal node split into male and female,        a valid method?

Dear Alberto,

I think the problem with including both males and females as separate datapoints in the analysis is that you're artificially doubling the sample size, which will make your statistical results difficult to interpret.

Why don't you do two separate analyses (or three)? One with males only, one with females only, and one on sexual dimorphism (some sort of difference or ratio or log-ratio variable -- people have used various metrics in the literature)?

Doing comparative analyses on 10 species is going to have very low power, no matter what you do, however.

Good luck!

On Nov 2, 2011, at 4:29 PM, Alberto Gallano wrote:

> Dear useRs,
> I am sorry if my previous question was not clear - my English speaking
> colleague helped me reword my question:
> I want to correlate a body size proxy to another (shape) variable using
> independent contrasts. *But*, but I want to split the data by sex (as there
> is much sexual dimorphism in body size in the species I study). This means
> I need to have a tree where each terminal species is actually made up of
> two nodes (male and female). I assume to do this I must make the branch
> lengths between the sexes within each species tiny (e.g., 1e-7), so that
> they are basically contemporaneous (it doesn't seem to work if branch
> lengths between sexes are set to zero). Is this the best way to apply
> correlation with PICs to each sex? Is there a problem with having each
> terminal taxon split by sex? (see tree object below)
> My variables are "bodySize" (a geometric mean proxy) and "var1" a 'shape'
> index - log10(var1 / bodySize). I want to look for an allometric effect in
> "var1" by correlating with "bodySize", after correcting for isometric size
> differences. My real data is for 10 species, but here I give an example
> with 3 species and each sex. I am mainly using Spearman's rho, as the small
> sample has many outliers, but I give example functions for Pearson's r as
> well below.
> thank you,
> Alberto
> # ---------------------------------
> # dummy datas
> set.seed(186)
> dat <- data.frame(bodySize=rnorm(6, 10), var1=rnorm(6, 5))
> rownames(dat) <- c("taxon1_M", "taxon1_F", "taxon2_M", "taxon2_F",
> "taxon3_M", "taxon3_F")
> # tree
> library(ape)
> tree <- structure(list(edge = structure(c(7L, 8L, 9L, 9L, 8L, 10L, 10L,
> 7L, 11L, 11L, 8L, 9L, 1L, 2L, 10L, 3L, 4L, 11L, 5L, 6L), .Dim = c(10L,
> 2L)), Nnode = 5L, tip.label = c("taxon1_M", "taxon1_F", "taxon2_M",
> "taxon2_F", "taxon3_M", "taxon3_F"), edge.length = c(3.4, 2.3999999,
> 1e-07, 1e-07, 2.3999999, 1e-07, 1e-07, 5.7999999, 1e-07, 1e-07
> ), root.edge = 0, tip.labels = c("taxon1_M", "taxon1_F", "taxon2_M",
> "taxon2_F", "taxon3_M", "taxon3_F")), .Names = c("edge", "Nnode",
> "tip.label", "edge.length", "root.edge", "tip.labels"), class = "phylo")
> # ----------------------------------
> # Pearson's r
> phyCorr <- function(x, y, tree){
>    r.pic <- pic(x, tree) %*% pic(y, tree) / sqrt( sum( pic(x, tree)^2 ) *
> sum( pic(y, tree)^2) )
>    return(r.pic)
> }
> corr <- phyCorr(dat$bodySize, dat$var1, tree)
> # -----------------------------------
> # Spearman's rho
> PICs <- function(d, phy){
>    dat.PICs <- array(dim=c(phy$Nnode, 2, ncol(d)))
>    for (i in seq_along(d)) {
>        dat.PICs[ , , i] <- pic(d[, i], phy, var.contrasts=TRUE)
>    }
>    return(dat.PICs)
> }
> char.PIC <- PICs(dat, tree)
> library(picante)
> PIC.tab <- cor.table(char.PIC[, 1, ], cor.method="spearman",
> cor.type="contrast")
>       [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-phylo mailing list
> R-sig-phylo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

R-sig-phylo mailing list
R-sig-phylo at r-project.org

More information about the R-sig-phylo mailing list