Constructing a frequency distribution for non-grouped data