colless.test
performs a test based on the Colless' index on tree data for the Yule or PDA model hypothesis.
sackin.test
does the same with the Sackin's index.colless.test(tree, model = "yule", alternative = "less", n.mc = 500)
sackin.test(tree, model = "yule", alternative = "less", n.mc = 500)
"treeshape"
."yule"
(default) or "pda"
."less"
(default) or "greater"
.subtree.test
colless
sackin
## Test on a randomly generated Yule tree with 30 tips
a<-rtreeshape(1,30,model="yule")
a<-a[[1]]
## Is it more balanced than a Yule tree ?
colless.test(a,alternative="less",model="yule")
## Is it less balanced than a PDA tree ?
colless.test(a,model="pda",alternative="greater")
## Test on the phylogenetic tree hiv.treeshape: is it more balanced than
## predicted by the Yule model?
data(hivtree.treeshape)
## The tree looks compatible with the null hypothesis
colless.test(hivtree.treeshape, alternative="greater", model="yule")
## What happen when we look at the top the tree?
colless.test(cutreeshape(hivtree.treeshape, 160, "top"),
alternative="greater", model="yule")
colless.test(cutreeshape(hivtree.treeshape, 160, "top"),
alternative="greater", model="pda")
## Test with the Sackin's index: is the HIV tree less balanced than
## predicted by the PDA model?
sackin.test(hivtree.treeshape,alternative="greater",model="pda")
## The p.value equals to 1...
Run the code above in your browser using DataLab