encode_simple_effect function

Encode a given factor variable using a simple effect encoding