Calculate mean from grouped frequency table (#916)