Finds the mean for a given class of values