View source: R/simulatePhyloPoissonLogNormal.R
nEffRatio | R Documentation |
Ratio between the tree sample size and the sample size of the equivalent problem with independent measures. A result larger than one indicates a problem that is made "easier" by the tree structure. Note that it strongly depends on the tip conditions (see examples).
nEffRatio(tree, id.condition, model, selection.strength)
tree |
A phylogenetic tree. If |
id.condition |
A named vector giving the state of each tip (sample). |
model |
The trait evolution model. One of "BM" or "OU". |
selection.strength |
If |
The ratio of sample sizes.
set.seed(1289)
## Ballanced tree
ntips <- 2^5
tree <- ape::compute.brlen(ape::stree(ntips, "balanced"))
## Alt cond : nEff greater than 1
id_cond <- rep(rep(0:1, each = 2), ntips / 4)
names(id_cond) <- tree$tip.label
plot(tree); ape::tiplabels(pch = 21, col = id_cond, bg = id_cond)
compcodeR:::nEffRatio(tree, id_cond, "BM", 0)
## Bloc cond : nEff smaller than 1
id_cond <- rep(0:1, each = ntips / 2)
names(id_cond) <- tree$tip.label
plot(tree); ape::tiplabels(pch = 21, col = id_cond, bg = id_cond)
compcodeR:::nEffRatio(tree, id_cond, "BM", 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.