Calculation of percentages of different groups