create_state_dummies {desla} | R Documentation |
Create State Dummies
Description
Creates state dummies for use in HDLP
.
Usage
create_state_dummies(x)
Arguments
x |
Contains the variables that define the states. Each column should either represent a categorical variable indicating the state of each observation, or each column should be a binary indicator for one particular state. |
Details
The function first checks if x
is already in the correct output format by evaluating if each row sums up to one. If this is not the case, each column is treated as a categorical variable for which its unique entries define the states it can take. If x
contains more than one column, interactions between the variables are created. Example, inputting two variables that can take two states each, results in a total of four possible states, and hence the output matrix contains four columns.
Value
A matrix where each column is a binary indicator for one state.