Description Usage Arguments Details Value References See Also Examples
Vectorized implementation of testing functions
1 2 3 4 5 |
x1 |
Mismatch counts in the test sample. |
n1 |
Sequencing depth (total counts) in the test sample. |
x2 |
Mismatch counts in the control sample. |
n2 |
Sequencing depth (total counts) in the control sample. |
delta |
Difference to test against (default: 0). |
... |
Additional arguments. |
These functions implement a vectorized version of the two-sided (a) Score test and (b) Miettinen-Nurminen test for the difference between to Binomial proportions.
Usage of the score test is discouraged in the settings considered here, since it is ill-defined for positions with no mismatches.
A data frame with columns
dhatEstimate for the difference of rates 'p1' and 'p2'.
p1, p2Estimates for the mismatches rates for each sample.
tvalT-value
pvalP-value
Miettinen, Olli, and Markku Nurminen. Comparative Analysis of Two Rates. Statistics in Medicine 4, no. 2 (1985): 213–226. doi:10.1002/sim.4780040211.
VariantTools package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Generate sample data
counts = data.frame(x1 = 1:5, n1 = 30, x2 = 0:4, n2 = 30)
## Score test
stat_st = with(counts, scoreTest(x1, n1, x2, n2))
## NM test
stat_nm = with(counts, nmTest(x1, n1, x2, n2))
## Fisher test
stat_fet = with(counts, feTest(x1, n1, x2, n2))
print(stat_st)
print(stat_nm)
print(stat_fet)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.