Description Usage Arguments Details Author(s) See Also Examples
A board is a matrix with non-negative integer elements; an
object of class board
. It
represents a contingency table; NA
entries specify structural
zeros. Function allboards()
takes a matrix x
, coerces
it to a board, then enumerates all boards with identical marginal
totals, and zeros at the same locations as the structural zeros of
x
.
1 2 3 4 5 |
x |
Matrix, coerced to integer. Usually with one or more
|
n |
Integer specifying how many boards to return. See details section |
use.C |
In function |
func |
In function |
normalize |
In function |
give.log |
Boolean specifying whether to return the log of the probabilities |
Function no.of.boards(x)
returns the number of boards with
non-negative entries that have the same marginal totals as x
and structural zeros where x
has NA
entries (that is,
permissible boards). Function allboards()
enumerates
such boards.
Function prob(x)
returns a number proportional to the
probability of observing x
, given the structural zeros and
marginal total.
Function is.1dof(x)
returns TRUE
if and only if x
is of the same form as gear
, and thus has only one degree of
freedom. Note that there exist other configurations which have only
one degree of freedom (such as any permutation of the rows and columns
of gear
).
Function maxlike(x)
returns the entry of allboards()
that has the highest probability of occurring. Compare best()
.
In functions no.of.boards()
and allboards()
, argument
n
is the maximum number of boards (or maximum count) returned,
except for special value 0
, which means to return (or count)
all possible boards.
(Actually, if there are more than n
permissible boards, the
first n+1
boards are returned by allboards()
, and
n+1
is returned by no.of.boards()
. This is because the
C
code checks for the last board having a successor).
Warning Many frequently-encountered boards have a very large
number of possible configurations, and if called with n=0
,
these functions will iterate for a very long time before
stopping.
Robin K. S. Hankin (R); Luke G. West (C++)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.