GenTab2 function

Two-way contingency table r x c - generation

Two-way contingency table r x c - generation

Generating a two-way contingency table r x c

GenTab2(pij, n)

Arguments

  • pij: a numeric matrix with non-negative probability values of the two-way contingency table
  • n: a sample size

Returns

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

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.

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)

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

Author(s)

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

  • Maintainer: Piotr Sulewski
  • License: GPL-3
  • Last published: 2023-09-14

Useful links