encode_helmert function

Encode a given factor variable using helmert encoding