Re: Well... go on then?
If there are 2 people in a group, and one of them is paid more... then what are you going to do? That may be discrimination (a woman and a man doing the same job for different pay), or it may just be that one is more senior / more experienced / better than the other.
Similarly, if there are 30 people in a group and only one is female, you have the same problem - the woman may be more or less senior / experienced / good than the male average.
If you have a "large enough" group, with a "large enough" number of women and a "large enough" number of men, and the average male level (seniority / experience / etc) is about the same as the average female level, then the average male pay should be the same as the average female pay.
As far as excluding groups that are too small: If you run this on most of your workers that are in suitable groups, and it doesn't find major discrimination, you can probably assume that there's no major discrimination in the company, including the other workers that are in groups too small to check.
(However, once people know that this will happen, that stops being true. Managers will know they can get away with discrimination against people who are already in small groups, and/or hide discriminated-against people in small groups. It is possible that changes their behaviour. People will always work for the metrics they're judged on. The first time this was done, people presumably didn't know it was going to happen, so it was a fair check).