get_grouping function

Generate a matrix of group membership for all individuals