quartetTreeTestInd {MSCquartets}R Documentation

Multiple independent hypothesis tests for quartet counts fitting a species tree under the MSC

Description

Perform a tree hypothesis test for all quartet counts in an input table, as if the counts for different choices of 4 taxa are independent.

Usage

quartetTreeTestInd(
  rqt,
  model = "T3",
  lambda = 0,
  method = "MLest",
  smallcounts = "approximate",
  bootstraps = 10^4,
  speciestree = NULL
)

Arguments

rqt

table of resolved quartet counts, as produced by quartetTableResolved, or quartetStarTestInd

model

"T1" for a specific species tree topology, or "T3" for any species tree topology, with these models explained more fully by Mitchell et al. (2019)

lambda

power divergence statistic parameter (e.g., 0 for likelihood ratio statistic, 1 for Chi-squared statistic)

method

"MLest", "conservative", or "bootstrap"; see quartetTreeTest for explanation

smallcounts

"bootstrap" or "approximate", method of obtaining p-value when some counts are small, so the chosen method is inappropriate

bootstraps

number of samples for bootstrapping

speciestree

species tree, in Newick as text, to determine quartet for T1 test; required for model="T1", ignored for model="T3"

Details

This function assumes all quartets are resolved. The test performed and the arguments are described more fully in quartetTreeTest.

Value

if model="T3", a copy of rqt with a new column "p_T3" appended with p-values for each quartet; if model="T1", a copy of rqt with 2 columns appended: "p_T1" with p-values, and "qindex" giving index of quartet consistent with specified species tree, i.e., 1 if 12|34 on species tree, 2 if 13|24, 3 if 14|23

References

Mitchell J, Allman ES, Rhodes JA (2019). “Hypothesis testing near singularities and boundaries.” Electron. J. Statist., 13(1), 2150-2193. doi:10.1214/19-EJS1576.

See Also

quartetTreeTest, quartetTestPlot, quartetStarTestInd, quartetTableResolved

Examples

gtrees=read.tree(file=system.file("extdata","dataGeneTreeSample",package="MSCquartets"))
tnames=c("t1","t2","t3","t4","t5","t6")
QT=quartetTable(gtrees,tnames)
RQT=quartetTableResolved(QT)
stree="(((t5,t6),t4),((t1,t2),t3));"
pTable3=quartetTreeTestInd(RQT,"T3")
quartetTablePrint(pTable3[1:6,])
stree="((((t5,t6),t4),t7),((t8,t9),((t1,t2),t3)));"
pTable1=quartetTreeTestInd(RQT,"T1",speciestree=stree)
quartetTablePrint(pTable1[1:6,])


[Package MSCquartets version 2.0 Index]