rctab {HDLSSkST}R Documentation

Generates an r\times c Contingency Table

Description

A function that generates an r\times c contingency table with the same marginal totals as given r\times c contingency table.

Usage

rctab(M)

Arguments

M

r\times c contingency table

Value

generated r\times c contingency table

Author(s)

Biplab Paul, Shyamal K. De and Anil K. Ghosh

Maintainer: Biplab Paul<paul.biplab497@gmail.com>

References

Cyrus R Mehta and Nitin R Patel (1983). A network algorithm for performing Fisher's exact test in rxc contingency tables, Journal of the American Statistical Association, 78(382):427-434, doi:10.2307/2288652.

Examples

# Generation of rxc Contingency Table:
   set.seed(151)
   mat <- matrix(1:20,5,4, byrow = TRUE)
   rctab(mat)

   ## outputs:
   #      [,1] [,2] [,3] [,4]
   #[1,]    3    4    0    3
   #[2,]    4    5   10    7
   #[3,]    8    7   12   15
   #[4,]   18   16   13   11
   #[5,]   12   18   20   24
   

[Package HDLSSkST version 2.1.0 Index]