Calculate mean and median.