I am currently working on an extension for research that requires me to measure whether the allocation of patents to examiners are random. I have sorted the data in order to conduct a Chi-squared test on the last digit to compare it to the expected number (which is the sum of patent applications/10). But I do not how to proceed from there. I have tried using the tabulate command (tabulate expected_no sumoflastdigit, chi2) with many different variations but it all doesn't seem right. There are 1370 observations in my data so some of the combination of variables I've tried also mentioned that there are too many values. Below is a screen capture of part of my data.