Comparing performances during a race between 2 groups, which test should I use? Imagine I organized a race between 2 types of ants. Type A and B.
At the end of the race, I have the ranking, which looks something like :
1 A1
2 A3
3 B5
4 A4
5 B2
...

Where, in A1, A is the ant type and "1" the ant ID. Ants do not interfere between each other during the race. 
If I plot the proportion of A or B every 10% of the ranking it gives this (fake data):

Maybe bar plot is better here. But one needs to read it as follow : 
There are 1000 ants in the race, I arbitrary divide the ranking in 10.
When 


*

*N = 1, that is the first 100, there are 54 Bs and 46 As. 

*N = 2, there are 50 As and Bs

*N = 3, 55 As and 45 Bs 

*N = 4, 61 As and 39 Bs

*etc..


My question is :
I have just ranking results and I want to known whether there is some bias in the ranking as a function of the type. eg. For a given ant, can one predict where it will rank ?
For instance, how can we say whether A-ants are very good at arriving in first positions 10%), and B-ants are very good at arriving in the 30-50% of the ranking, or not, but both are equally good at performing bad. (I don't want to test for this, but how can I end up with results of that kind).
I have many replicate of this experiment.
I don't really know how to test for this. I was thinking of:


*

*dividing the ranking in N parts (how to choose N ?)

*Doing a $\chi^{2}$ test for each part, where I expect 50% of type A and B under null hypothesis. : No because parts are dependants.

*I don't know.


How would you do, and why ?
Note that the ranking doesn't include values (eg. time), so we only have ranking information.
In case we would have the time value, how would you do, if different ?
I would appreciate some re-wording of the problem, since I'm not a statistician and it prevents me to search in books (because I don't known where to search)
Thanks
 A: You could do a two-sample t test on the ranks to check the null hypothesis of equal average rank. This is basically the same as a Wilcoxon rank-sum test on the original times for the null hypothesis 'no difference between A and B in typical performance'.
The analysis will be easier if you split rank and type in two columns (one with the rank and/or time and one with the type).
A: I think there are some issues with the question as posted by @jeanrjc. I will address some of the issues and try to answer some of them, but I do not know the whole answer. 
First, the figure in the question does not seem to be what the OP said it is. It does not seem to be the proportion of A and B IN the Nth ranking (in the 20% ranking) but seems to be the number of As and Ba UP TO the Nth ranking. This will explain why at the end of the figure the proportions of As and Bs stabilizes around 50% - 50% of the ants that terminated up to the 100% ranking are A and 50% are B!
Second point: the OP seems to be interested in performing both an exploratory analysis and a confirmatory analysis with the same data! For example, one can see that at 40% the differences between A and B seems to be at the highest, and so the p-value of any test would be at the lowest. One can make then a very high evidence statement that B ants are much more likely to arrive in the top 40% than A ants. What happened is that one looked at the data to find the maximal difference between A and B (the exploratory part) and then performed a test to verify that the difference was significant (the confirmatory part). Another example is the OPs statement:  "but both are equally good at performing bad." - just select a region where there is the least difference between A and B, and then show that the differences are not significant in this region. 
This mixing of exploratory and confirmatory analysis ON THE SAME DATA makes me very uncomfortable (I dont know the name of the this "error" in statistics, but in machine learning it is sometimes called overfitting - the idea that one can select the best parameters/statements on a "test" set and expect that it will work as well on yet unknown data). If one must do both a exploratory and a confirmatory analysis, I would do it an different sets of races. Select a random set of races to find the "best statements" and test these statements on the remaining races. 
The third issue is that a hypothesis testing require a hypothesis to be tested. Isn't there statements that are meaning full to your problem that you can define before looking to the data? If you want to find out if A ants are faster than B ants, is not enough to test if A ants are significantly more likely to be among the top 50% than B ants?
Maybe the OP does not have a single statement but wants to test 10 statements of the form: A ants are more likely then B ants to be among the top N%, for N=10, 20, 30..100
In this case there is the fourth problem: multiple comparisons. If you make 10 statements/tests, each with a 5% change of being wrong (95% confidence on your tests) then there is a 50% chance that one of your statements will be wrong ( well not exactly but close). Thus one must be careful on how many tests are being made and adjust the confidence level on each test appropriately. Please follow the tags: multiple-comparisons, pairwise-comparison or multiple-hypothesis in CV.
The last issue is that if one decides to make multiple tests, these tests are not independent. For example, given that the difference between A and B are at the highest/most significant at the 40% according to the figure in the question, it is unlikely that the difference will not be significant at the 50%. In other words, given that you already know that B is more likely than A to be among the top 40%, I dont think the correct null hypothesis for the 50% is that they are both equally likely! But I dont know how to solve this problem.
