Learn R Programming

USP (version 0.1.2)

DiscStat: 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 BKS2020USP 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

BKS2020USP

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab