# Binomial Data, uneven sample sizes, how do analyze this data?

I work with nonhuman primates, and have had them (4 total) perform a series of 3 tasks. Each of the three tasks are 2 choice categorization tasks. So the data is correct/incorrect for each trial. There was not a set number of trials for each task, instead they had to meet a criterion of 85% correct in their last 120 trials. When the program beings, it creates an array of 60 1s and 60 0s, starting the participant at 50% correct. As the trials progress, the array is updated with either a 1 or 0 based on that trial. The first position in the array is replaced with a 1 or 0 depending on if they were correct or not in trial 1, position 2 in the array is replaced when trial 2 completed, etc... trial 121 replaces position 1 in the array, and so on. If they complete 160 trials, it looks at trials 41-120 to determine if they have finished. Because it starts at 50% correct they can meet criterion in less than 120 trials.

So what I have from each participant is repeated measures binomial data from 3 tasks varying in size (for example they may have finished task 1 in 306 trials, task 2 in 115 trials, and task 3 in 144 trials). For each primate, I want to be able to compare their performance between each task. Was performance significantly different between tasks? However, I am finding this to be impossible. I'm unable to find a test that will take binomial data of uneven sample sizes. I've looked mostly into a variety of Chi-square options, but it seems those only work well with even sample sizes. I used the Cochran's Q test to look at early performance (first 100 trials), but need to also be able to look at overall performance.

• You say 85% accuracy for 120 trials is the stopping rule. Is this a moving window? For instance, if I mess up the first 16% of the 120 trials (i.e. 20 failures), but successfully complete the subsequent 120, am I done? Or if I mess up the first 20 trials, does it not matter what the next 100 are, I need to wait to do the next batch of 120 and fail no more than 19? – AdamO Mar 3 at 21:52
• @AdamO When the program beings, it creates an array of 60 1s and 60 0s, starting the participant at 50% correct. As the trials progress, the array is updated with either a 1 or 0 based on that trial. The first position in the array is replaced with a 1 or 0 depending on if they were correct or not in trial1, position2 in the array is replaced when trial 2 completed, trial121 replaces position1 in the array, etc. If they complete 160 trials, it looks at trials 41-120 to determine if they have finished. Because it starts at 50% correct they can meet criterion in less than 120 trials. – Brooke Jackson Mar 3 at 23:11
• Please add this new details to the post as an edit. Not everybody reads comments! – kjetil b halvorsen Mar 4 at 14:06
• @kjetilbhalvorsen I will add it. However I'm not sure why it is really relevant to my question? I am trying to look at performance on ALL trials. – Brooke Jackson Mar 5 at 15:08