Generate stats from data.