View source: R/summaryStatistics.R
compare_CherryFreqs | R Documentation |
Performs a chi-squared test to compare the distribution of methylation states
(unmethylated 0
, partially-methylated 0.5
, and methylated 1
)
between two cherry tips. A cherry is a pair of leaf nodes (also called tips or terminal nodes)
in a phylogenetic tree that share a direct common ancestor.
compare_CherryFreqs(tip1, tip2, testing = FALSE)
tip1 |
A numeric vector representing methylation states ( |
tip2 |
A numeric vector representing methylation states ( |
testing |
Logical; if |
The function uses simulate.p.value = TRUE
in chisq.test
to compute the p-value via Monte Carlo simulation to improve reliability
regardless of whether the expected frequencies meet the assumptions of the chi-squared test
(i.e., expected counts of at least 5 in each category).
If testing = TRUE
, returns a list with the contingency table and chi-squared test results.
Otherwise, returns the p-value of the test.
tip1 <- c(0, 0, 1, 0.5, 1, 0.5)
tip2 <- c(0, 1, 1, 0, 0.5, 0.5)
compare_CherryFreqs(tip1, tip2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.