generate_stacked_data function

Generation of Stacked Data by Subgroups