CountTest: Count test

Description Usage Arguments Value References Examples

View source: R/CountTest.R

Description

This function tests whether the counts in a given window are identical across groups with respect to the total counts across all windows.

Usage

1
CountTest(G, N, W, type = "conditional", p_null = 0.5)

Arguments

G

Vector of the group label of each observation. Labels are integers starting from 1.

N

Vector of the total counts across all window for each group.

W

Total number of windows.

type

Indicates whether the test is conditional on the total counts for each group (conditional), or conditional only on the sum of the total counts for all groups combined (marginal).

p_null

Prior null probability.

Value

An ARMT object.

References

Soriano J. and Ma L. (2014). Multi-resolution two-sample comparison through the divide-merge Markov tree. Preprint. http://arxiv.org/abs/1404.3753

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1)
n = 1000
W = 10
u = 100
X = runif(n, min = 0, max = u)
G = c(rep(1,n/2), rep(2,n/2))
X1 = X[ X < u/W ]
G1 = G[ X < u/W ]
ans = ARMT(X=X1, G=G1)
CountTest(G1, table(G), W = W)

jacsor/ARMtree2 documentation built on May 17, 2017, 6:49 a.m.