Learn R Programming

cabootcrs (version 2.1.0)

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

input
Jk
maxcat
varandcat
vars

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

See Also

Other conversion functions: convert(), getBurt(), getdoubled(), getindicator()

Examples

Run this code
# NOT RUN {
nishCTvars23 <- getCT(NishData,Jk=rep(3,4),vars=2:3)

# }

Run the code above in your browser using DataLab