getCT: Converting a data matrix into a contingency table
Description
getCT recodes a data matrix from one format (n objects by p variables,
counts for distinct combinations of p variables, indicator matrix or Burt matrix) into a contingency table,
for cases where table() doesn't work
Usage
getCT(
Xinput,
input = "nbyp",
Jk = NULL,
maxcat = NULL,
varandcat = TRUE,
vars = NULL
)
Arguments
Xinput
A data matrix, in the form of a data frame or similar
A list of the variable numbers to be used in the contingency table when there are more than 2.
If not all variables are wanted and the input is not n by p then Jk must be specified.
Value
A contingency table, giving counts for the two cross-classified variables