simula: Simulations of three-way contingency tables

Description Usage Arguments Author(s) References Examples

View source: R/simula.R

Description

Allows the generation of random contingency tables with prescribed theoretical probabilities

Usage

1
simula(I, J, K, nran = 1000, pi, pj, pk)

Arguments

I

The input parameter for specifying the number of rows.

J

The input parameter for specifying the number of columns.

K

The input parameter for specifying the number of tubes.

nran

The input parameter for specifying the number of individuals in each table.

pi

The input parameter for specifying the theoretical probability of rows.

pj

The input parameter for specifying the theoretical probability of columns.

pk

The input parameter for specifying the theoretical probability of tubes.

Author(s)

Lombardo R, Takane Y and Beh EJ

References

Lancaster H O (1951) Complex contingency tables treated by the partition of the chi-square. Journal of Royal Statistical Society, Series B, 13, 242-249.
Loisel S and Takane Y (2016) Partitions of Pearson's chi-square ststistic for frequency tables: A comprehensive account. Computational Statistics, 31, 1429-1452.

Examples

1
2
3
4
5
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.
simula(4,3,2,pi=rep(1/4,4),pj=rep(1/3,3),pk=rep(1/2,2))
## The function is currently defined as

Example output

Loading required package: tools
$Fijk
, , 1

     [,1] [,2] [,3]
[1,]   41   42   37
[2,]   42   34   41
[3,]   40   33   50
[4,]   45   32   39

, , 2

     [,1] [,2] [,3]
[1,]   31   49   48
[2,]   40   46   47
[3,]   34   56   41
[4,]   37   45   50


$pi
[1] 0.25 0.25 0.25 0.25

$pj
[1] 0.3333333 0.3333333 0.3333333

$pk
[1] 0.5 0.5

chi2x3way documentation built on May 2, 2019, 4:16 a.m.

Related to simula in chi2x3way...