Median from frequency table