DiscStat {USP}R Documentation

Test statistic for dependence in contingency table

Description

This function computes the value of the test statistic T_n measuring the strength of dependence in a contingency table. See Section 3.1 of (Berrett et al. 2021) for a definition.

Usage

DiscStat(freq)

Arguments

freq

Two-way contingency table whose strength of dependence is to be measured.

Value

A list containing the value of the test statistic T_n, the table of expected null counts, and the table of contributions to T_n.

References

Berrett TB, Kontoyiannis I, Samworth RJ (2021). “Optimal rates for independence testing via U-statistic permutation tests.” Annals of Statistics, to appear.

Examples

freq=r2dtable(1,rep(10,5),rep(10,5))[[1]]; DiscStat(freq)

freq=diag(1:5); DiscStat(freq)

freq=r2dtable(1,rep(10,5),rep(10,5))[[1]] + 4*diag(rep(1,5))
DiscStat(freq)

[Package USP version 0.1.2 Index]