gen_group_reg function

Expand a regressor matrix for a group analysis.