Implement data statistic function.