generate statistics for each group of a given course