mean from a frequency table