I have a bunch of subjects. These subjects can pair up (in unordered pairs), and can do so repeatedly, even repeatedly to the same other subject. So I have a list of pairings and how many times each has occurred. (An example might be a bunch of people and how many times any two of them has shaken hands.)
Now, each such pairing can be between 'like' subjects or between 'unlike' subjects. (There's a definition I use for 'like'; it's an equivalence, if that matters.) (In the example, you might consider handshakes between people of precisely the same surname or of not precisely the same surname.)
I wish to test whether a pairing of 'like' subjects is more likely than a pairing of 'unlike' subjects. How can I do this? Please bear in mind that I need to take into account that some of the subjects are less likely to pair altogether. (In the example, I'd want to know whether people of the same surname are more likely to shake hands. But I'd need to bear in mind that some people just shake hands more in general.)
I'll indicate what I've tried, but I don't know whether it's correct. I welcome confirmation that it's correct, explanation of why it's not, recommendation for fixing it, and/or wholly different methods. I did as follows: For each subject, find how many pairings it's in; call that its score. For any two subjects, find the product of their scores; call that the pair's score. Then, for the two subjects, find the actual number of pairings; divide that by the pair's score (which is to take into account the fact that some subjects are less likely to pair altogether). Consider this last number as the dependent variable and use ANOVA with 'like' and 'unlike' as my groups.
(Another idea I had was to use the pair's score (as above) as a factor in an ANCOVA (with, of course, 'like' and 'unlike' as the other factor, and the actual number of pair's pairings as the dependent variable). This seemed more intuitive, actually. But ANCOVA requires that the regression lines for the dependent variables against the continuous variables have equal slope for the different categorical variables, and in my case the slopes are 0.019 and 0.24.)