Learn R Programming

PSIndependenceTest (version 0.0.1)

Mod2.pvalue: Modular test for independence in two-way contingency table

Description

Calculates the p-value of the modular test for independence in two-way contingency table

Usage

Mod2.pvalue(stat, nr, nc, n, B = 10000)

Value

The function returns the p-value of the modular test.

Arguments

stat

a modular statistic value

nr

a number of rows

nc

a number of columns

n

a sample size

B

an integer specifying the number of replicates used in the Monte Carlo test (optional)

Author

Piotr Sulewski, piotr.sulewski@apsl.edu.pl, Pomeranian University in Slupsk.

Details

The p-value of the modular test for independence in r x c contingency table,

References

Sulewski, P. (2016). Moc testów niezależności w tablicy dwudzielczej większej niż 2×2, Przegląd statystyczny 63(2), 190-210

Examples

Run this code
pij=matrix(1/4, nrow = 2, ncol = 2)
tab4=GenTab2(pij, 30)
Mod2.pvalue(Mod2.stat(tab4), 2, 2, 30, B=1e3)
Mod2.pvalue(2.5, 3, 2, 60)

Run the code above in your browser using DataLab