prop-tests: Testing Functions

Description Usage Arguments Details Value References See Also Examples

Description

Vectorized implementation of testing functions

Usage

1
2
3
4
5
scoreTest(x1, n1, x2, n2)
  
nmTest(x1, n1, x2, n2, delta = 0)

feTest(x1, n1, x2, n2, ...)

Arguments

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.

Details

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.

Value

A data frame with columns

References

Miettinen, Olli, and Markku Nurminen. Comparative Analysis of Two Rates. Statistics in Medicine 4, no. 2 (1985): 213–226. doi:10.1002/sim.4780040211.

See Also

VariantTools package

Examples

 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)

Rariant documentation built on Nov. 1, 2018, 2:25 a.m.