# Establishing Groupings Based on Behavior

Consider the following scenario:

Collection of user data from a community site similar to StackExchange reveals that certain users tend to "agree" with other users; e.g., when participating in the same posts, they tend to upvote or downvote together. Simultaneously, certain users tend to "disagree" with each other. Again, when they participate in the same posts, they vote the same.

An example of collected data might look like this:

thread1:
8fsygfs // Each key (e.g., "8fsygfs") represents a user
atw9g87
atw923swg87
34j2njk"
jne280n
892ned9
28hd0ye
cjsnd09
02jd0d2
02jd0d2
8fsygfs
7dr4229
232c3f25
34j2njk
atw9g87
atw923swg87
jne280n
9ah8229
89h208d
28hd0ye
cjsnd09
02jd0d2
9ah8229
838w32l
78awg2l
34j2njk
jne280n
atw9g87
892ned9
28hd0ye


If we parse this data, we can extract the absolute number of times that a given user votes the same as the rest of the users.

 34j2njk:          // The users below have "agreed" with this user
8fsygfs: 2,     // 2 times...
atw9g87: 2,     // 2 times...
atw923swg87: 2, // 2 times...
02jd0d2: 2,     // 2 times...
7dr4229: 1,     // 1 time ...
232c3f25: 1,
9ah8229: 1,
838w32l: 1,
78awg2l: 1


There are a number of other ways to parse this data. Another example is to look at how often a user agrees with other users. Here I've set a threshold where users must participate in the same thread at least 3 times before we calculate how often they "agree."

 34j2njk: // The users below "agree" with this user...
atw9g87: 0.6666666666666666, // 66% of the time
02jd0d2: 0.6666666666666666
atw9g87:  // ... and this user...
34j2njk: 0.6666666666666666,
jne280n: 0.3333333333333333, // 33% of the time
28hd0ye: 0.3333333333333333,
02jd0d2: 0.3333333333333333


How might I approach this data if I want to establish "poles" that represent user behavior? For example, toward one pole you'd have a group of users who tend to agree with each other. Toward the other pole, you'd have a group of users who tend to disagree with the former group. In the real world, users would fall somewhere between. I'd like to create an index that represents where in the space between each user falls.

To be specific, I'm looking for exposure to any concepts that would be helpful in this goal. I'm not looking for anyone to approach the data for me. As a lay person, I'd like to know what terms, concepts and areas of statistics and math in general would be helpful to me in exploring this further.

• Sounds interesting but how do you approach this? I am not familiar with the programming language you used for the code in your example. Mar 25 '17 at 22:40
• Hmm. You have a good point. These are just objects. They don't perform any tasks. They only act as models, in this case lists. But they may be a distraction for people without programming backgrounds. Can you suggest a format that would be more appropriate for this community? Mar 25 '17 at 22:44
• I've edited the models a bit to be more agnostic. Hope this is helpful. Mar 25 '17 at 22:57