adding mean, median and average per interval