Learn R Programming

adiv (version 1.2)

K: Indices K, Kstar and Kw of Phylogenetic Signal

Description

The function K calculates Blomberg et al. (2003) statistic K and performs a permutation test where species identities are maintained in the phylogeny while the trait values of species are randomly shuffled (permuted) (Pavoine and Ricotta 2013).

The function Kstar calculates Blomberg et al. (2003) statistic K* and performs a permutation test where species identities are maintained in the phylogeny while the trait values of species are randomly shuffled (permuted) (Pavoine and Ricotta 2013).

The function Kw calculates Pavoine and Ricotta (2013) statistic \(K_w\) and performs a permutation test where species identities are maintained in the phylogeny while the trait values of species are randomly shuffled (permuted).

Usage

K(phyl, trait, nrep = 999, alter = c("greater", "less", "two-sided"))

Kstar(phyl, trait, nrep = 999, alter = c("greater", "less", "two-sided"))

Kw(phyl, trait, nrep = 999, alter = c("greater", "less", "two-sided"))

Arguments

phyl

an object inheriting the class phylo (see package ape), phylo4 (see package phylobase) or hclust.

trait

a vector with the trait value for each species (tip) in the phylogenetic tree. Trait values for species must be in the same order as species in the phylogenetic tree.

nrep

a numeric: the number of randomizations

alter

a character specifying the alternative hypothesis; must be one of "greater" (phylogenetic signal; the default), "less" or "two-sided". If several values are given, only the first one is retained.

Value

Each function returns an object of class randtest with the results of the permutation tests. (see function randtest in package ade4)

References

Blomberg, S.P., Garland, T., Ives, A.R. (2003) Testing for phylogenetic signal in comparative data: behavioral traits are more labile. Evolution, 57, 717--745.

Pavoine, S., Ricotta, C. (2013) Testing for phylogenetic signal in biological traits: the ubiquity of cross-product statistics. Evolution, 67, 828--840.

See Also

See Also Kstar, Kw

Examples

Run this code
# NOT RUN {
data(rockfish)
phy <- read.tree(text=rockfish$tre)
K(phy, rockfish$traits[phy$tip.label, 1])
Kstar(phy, rockfish$traits[phy$tip.label, 1])
Kw(phy, rockfish$traits[phy$tip.label, 1])
# }

Run the code above in your browser using DataLab