Add statistic analysis logic.