encode_mnl function

Encode a given factor variable using a multinomial logit representation