table_data {exams.forge} | R Documentation |
Frequency Table
Description
Creates a frequency table where all entries can be written as 2^{p_{ij}} 5^{q_{ij}}
. It holds that p_{ij}<m2
and q_{ij}<m5
.
If the algorithm does not find a solution, then an error is thrown. Try to increase unit
to 20, 50, 100 and so on.
Once a table is found, the table is normalized by dividing all entries by a number such that the entries are still integer.
Finally, a multiplicator of the form 2^p 5^5
is randomly chosen, ensuring that the sum of the entries is less than, or equal to n
.
Usage
table_data(
nrow,
ncol,
unit = 10,
maxit = 1000,
n = 100,
m2 = ceiling(log(n)/log(2)),
m5 = ceiling(log(n)/log(5))
)
freq_table(
nrow,
ncol,
unit = 10,
maxit = 1000,
n = 100,
m2 = ceiling(log(n)/log(2)),
m5 = ceiling(log(n)/log(5))
)
dtable(
nrow,
ncol,
unit = 10,
maxit = 1000,
n = 100,
m2 = ceiling(log(n)/log(2)),
m5 = ceiling(log(n)/log(5))
)
Arguments
nrow |
integer: number of rows |
ncol |
integer: number of columns |
unit |
integer: reciprocal of smallest non-zero probability (default: |
maxit |
integer: maximal number of iterations (default: |
n |
integer: maximal sum of table entries (default: |
m2 |
integer: maximal power of two used on normalized the table (default: |
m5 |
integer: maximal power of five used on normalized the table (default: |
Value
A frequency table where all entries can be written as 2^{p_{ij}} 5^{q_{ij}}
.
Examples
tab22 <- table(2, 2)
tab22
divisor_25(tab22)
nom.cc(tab22) # Should be zero
#
table(3, 2)
table(4, 2)