Calculate hist using raw data