GenTab2 {PSIndependenceTest}R Documentation

Two-way contingency table r x c - generation

Description

Generating a two-way contingency table r x c

Usage

GenTab2(pij, n)

Arguments

pij

a numeric matrix with non-negative probability values of the two-way contingency table

n

a sample size

Details

Generating a two-way contingency table r x c using the probability matrix pij. If Ho is true then pij equals 1 / r / c.

Value

The function returns the two-way contingency table r x c

Author(s)

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

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

r = 6; c = 2
GenTab2(array(1 / r / c, dim = c(r, c)), 93)
GenTab2(matrix(c(0.125,0.25,0.25,0.375), nrow=2), 100)


[Package PSIndependenceTest version 0.0.1 Index]