# quartetTreeTestInd: Multiple independent hypothesis tests for quartet counts... In MSCquartets: Analyzing Gene Tree Quartets under the Multi-Species Coalescent

## 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

 ```1 2 3 4 5 6 7 8 9``` ```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 \insertCiteMAR19;textualMSCquartets `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

\insertRef

MAR19MSCquartets

`quartetTreeTest`, `quartetTestPlot`, `quartetStarTestInd`, `quartetTableResolved`
 ``` 1 2 3 4 5 6 7 8 9 10``` ```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,]) ```