ec_undummy function

Converts a set of dummy variables into a single categorical variable