getindicator: Converting a data matrix into an indicator matrix
Description
getindicator
recodes a data matrix from one format (n objects by p variables,
counts for distinct combinations of p variables, contingency table) into an indicator matrix
Usage
getindicator(
Xinput,
input = "nbyp",
Jk = NULL,
maxcat = NULL,
varandcat = TRUE
)
Arguments
Xinput
A data matrix, in the form of a data frame or similar
Value
An indicator matrix, where a variable with J_k categories is represented by J_k columns and a
data point taking the i-th category has 1 in the i-th of these columns and a zero in the others
Examples
Run this code# NOT RUN {
nishindicator <- getindicator(NishData)
# }
Run the code above in your browser using DataLab