Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assortativity (people associate based on common attributes)

Similar presentations


Presentation on theme: "Assortativity (people associate based on common attributes)"— Presentation transcript:

1 Assortativity (people associate based on common attributes)

2 Are people associating based on gender similarity?

3 Homophily or assortativity
Sociologists have observed network partitioning based on the following characteristics: Friendships, acquaintances, business relationships Relationships based on certain characteristics: Age Nationality Language Education Income level Homophily: It is the tendency of individuals to choose friends with similar characteristic. “Like links with like.” How do we compute it?

4 calculate the actual number of the same gender ties
Naïve Approach: calculate the actual number of the same gender ties

5 First Make a Block Model
adjacency matrix Attribute N1 N2 N3 N4 N5 N6 N7 N8 N9 Male 1 Female

6 First Make a Block Model
Attribute N1 N2 N3 N4 N5 N6 N7 N8 N9 Female 1 Male

7 First Make a Block Model
Attribute N2 N4 N9 N1 N3 N5 N6 N7 N8 Female 1 Male

8 First Make a Block Model
Block Densities 5 6⋅3 Attribute N2 N4 N9 N1 N3 N5 N6 N7 N8 Female 1 Male

9 Naïve Approach – calculate the fraction of same gender ties
1 2 3 4 5 6 7 8 9 10 N1 N6 N3 N2 N7 N4 N8 N5 N9 72% (13/18) of the edges are between vertices of the same gender

10 Finding the number of same-class ties
(“Turn off the mixed-class ties with a Kronecker Delta”) Kronecker Delta 𝛿 𝑐 𝑖 , 𝑐 𝑗 = 0, 𝑖𝑓 𝑐 𝑖 ≠ 𝑐 𝑗 &1, 𝑖𝑓 𝑐 𝑖 = 𝑐 𝑗

11 Finding the number of same-class ties
(“Turn off the mixed-class ties with a Kronecker Delta”) Kronecker Delta Actual number of same-class ties 𝛿 𝑐 𝑖 , 𝑐 𝑗 = 0, 𝑖𝑓 𝑐 𝑖 ≠ 𝑐 𝑗 &1, 𝑖𝑓 𝑐 𝑖 = 𝑐 𝑗 𝑒𝑑𝑔𝑒𝑠 (𝑖,𝑗) 𝛿 𝑐 𝑖 , 𝑐 𝑗 = 1 2 𝑖𝑗 𝐴 𝑖𝑗 𝛿 𝑐 𝑖 , 𝑐 𝑗 =13

12 estimating the number of expected edges
Kleinberg’s method: estimating the number of expected edges

13 Proportion of Males and Females
Nodes: P(male) p = 6/9 N3 Males N2 Total number of nodes Nodes: P(Female) q = 3/9 N7 N4 Females Total number of nodes N8 N5 N9

14 Probability of Selecting a Male or Female
Nodes: P(male) p = 6/9 p = 2/3 N3 N2 Nodes: P(Female) q = 3/9 q = 1/3 N7 N4 N8 N5 N9

15 Probability of a Male selecting a
Male-Male, Female-Female, Male-Female N1 N6 Nodes: P(male) p = 6/9 p = 2/3 N3 Edges: P(m-m) p2 =4/9 N2 Nodes: P(Female) q = 3/9 q = 1/3 N7 N4 Edges: P(f-f) q2 =1/9 N8 N5 N9 Edges: P(male-female) P(female-male) 2pq = 4/9

16 Male-Male, Female-Female, Male-Female Ties
Expected number of Male-Male, Female-Female, Male-Female Ties N1 N6 Nodes: P(male) p = 6/9 p = 2/3 N3 Edges: P(m-m) p2 =4/9 p2 =8/18 N2 Nodes: P(Female) q = 3/9 q = 1/3 N7 N4 expecting 8 edges to be male-male out of the total 18 edges Edges: P(f-f) q2 =1/9 q2 =2/18 N8 N5 N9 Edges: P(male-female) P(female-male) 2pq = 4/9 2pq = 8/18

17 Expected number of Male-Male, Female-Female, Male-Female Ties
Nodes: P(male) p = 6/9 p = 2/3 N3 Edges: P(m-m) p2 =4/9 p2 =8/18 8 M-M N2 Nodes: P(Female) q = 3/9 q = 1/3 N7 N4 Edges: P(f-f) q2 =1/9 q2 =2/18 2 F-F N8 N5 N9 Edges: P(male-female) P(female-male) 2pq = 4/9 2pq = 8/18 8 M-F Total expected # of same gender ties/edges: 10

18 “Make connections at random while preserving the vertex degrees.
Newman’s approach “Make connections at random while preserving the vertex degrees. Ignoring vertex degrees and making connections truly at random has been shown to give much poorer results” 1 2 𝑖𝑗 𝑘 𝑖 𝑘 𝑗 2𝑚 𝛿 𝑐 𝑖 , 𝑐 𝑗 Note: 2𝑚 is sum of degrees, where 𝑚 is the number of edges

19 Expected number of same-class ties
m = number of edges = 18 1 2 𝑖𝑗 𝑘 𝑖 𝑘 𝑗 2𝑚 𝛿 𝑐 𝑖 , 𝑐 𝑗 =10.36

20 Computing Assortativity/Homophily:
The difference between the present number of same ties and the expected number of same ties

21 Measuring the Presence of Homophily – Calculating modularity
If there is no homophily effect, we should expect to see same gender ties. Since we see 13 same gender ties instead of 10.36, there is some evidence of homophily We see about 3 more same gender ties than we would expect if gender had no effect on tie formation. 1 2 𝑖𝑗 𝐴 𝑖𝑗 𝛿 𝑐 𝑖 , 𝑐 𝑗 − 1 2 𝑖𝑗 𝑘 𝑖 𝑘 𝑗 2𝑚 𝛿 𝑐 𝑖 , 𝑐 𝑗 = 1 2 𝑖𝑗 𝐴 𝑖𝑗 − 𝑘 𝑖 𝑘 𝑗 2𝑚 𝛿 𝑐 𝑖 , 𝑐 𝑗

22 Measuring the Presence of Homophily - Calculating modularity
If there is no homophily effect, we should expect to see 57.55% (10.36/18) same gender ties. Since we see 72.22% (13/18) same gender ties instead of 57%, there is some evidence of homophily We see 14.6% more same gender ties than what we would expect if gender had no effect on tie formation. The modularity score (difference) is 0.146 𝑄= 1 2𝑚 𝑖𝑗 𝐴 𝑖𝑗 − 𝑘 𝑖 𝑘 𝑗 2𝑚 𝛿 𝑐 𝑖 , 𝑐 𝑗 =.7222−.5755= 0.146

23 Making Sociology Relevant: What do we want to say?
A few empirical facts: Some racially heterogeneous schools are socially segregated

24 Making Sociology Relevant: What do we want to say?
A few empirical facts: … while other heterogeneous schools are socially integrated. Why?

25 Making Sociology Relevant:
What do we want to say?

26 Scalar Characteristics
Assortative Mixing by Scalar Characteristics

27

28 How do we compute/visualize it with NetworkX and Python?

29 Assortativity/Homophily in Gephi
Here (the inner circle is the hub node)

30 Assortativity/Homophily in Python
In NetworkX, to check degree Assortativity (categories are the degrees rather than gender): assortivity = nx.degree_assortativity_coefficient(G) To check an attribute’s assortativity (the attribute “gender” can be replaced by other attributes that your data was tagged with): assortivity = nx.attribute_assortativity_coefficient(G, “gender“)


Download ppt "Assortativity (people associate based on common attributes)"

Similar presentations


Ads by Google