**More specifically:**

My work is ecologically-oriented: I have captured different-sized groups of a rodent, and in each group there is a phenotype that always occurs once. I can therefore know the order in which individuals with certain phenotypes (inc. the phenotype of interest) were captured in each group. I then want to know whether the specific phenotype tends to occur earlier or later in the sequence than that expected by chance.

I think it will involves some sort of permutation test whereby I randomly re-sample individuals within each group, but I am unsure how to handle the different group sizes (example dataset below).

thanks for any help in advance

Jack

Group Phenotype Order

A 1 1

A 0 2

A 0 3

A 0 4

A 0 5

B 0 1

B 0 2

B 0 2

B 1 4

B 0 5

B 0 6

C 0 1

C 0 2

C 1 3