Download presentation
Presentation is loading. Please wait.
Published byScot Cameron Modified over 8 years ago
1
Social Network Analysis in R
2
1 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision What is Social Network Analysis? A way of mapping and measuring relationships Can be applied to many types of networks Provides visual inspection, as well as mathematical analysis A way to understand complex problems within a network of people or objects
3
2 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Objectives To identify important entities/people within a given network To find people within a network that can influence other people’s behavior
4
3 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Social Networks are Everywhere
5
4 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Social Networks are Everywhere
6
5 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision The Mathematics: Graph Theory
7
6 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Software has many network analysis packages: igraph, SNA, S.N.O.R.T., tnet
8
7 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Pitfalls Not a one person job The necessary computers are very expensive The most basic measurements are computationally expensive Sampling is virtually impossible Data is not easy to obtain Data can be very large
9
8 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Ever Expanding Data
10
9 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Ever Expanding Data
11
10 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Metrics Mohamed Atta Essid Sami Ben Khemais Zacarias Moussaoui Marwan Al-Shehhi Social Network Analysis metrics measure the importance of a particular node Measures of “center”
12
11 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Betweeness Centrality
13
12 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Betweeness Centrality Zacarias Moussaoui Mohamed Atta Hani Hanjour Betweeness Atta.588 Khemais.252 Moussaoui.232 Alhamzi.154 Hanjour.126 Essid Sami Ben Khemais Nawaf Alhamzi
14
13 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Closeness Centrality
15
14 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Closeness Centrality Special case: Graphs that are not connected
16
15 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Closeness Centrality Mohamed Atta Ramzi Bin al-Shibh Marwan Al-Shehhi Nawaf Alhamzi Hani Hanjour Closeness Atta.588 Al-Shehhi.466 Hanjour.445 Alhamzi.442 Al-Shibh.436
17
16 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Custom Metrics
18
17 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision First Order Influence Centrality first.order.influence<-function(g,vids,weight=NULL,nodeweight=NULL){ result<-vector('numeric',length(vids)) if(is.null(nodeweight)==F){ nweight<-sum(nodeweight) }else{ nweight<-vcount(g) } for(z in 1:length(vids)){ arcs<-incident(g,vids[z],'out') if(length(arcs)==0){ next } if(is.null(weight)==F){ if(is.numeric(weight)==F){ arcweights<-sum(get.edge.attribute(g,weight,arcs)) }else{ arcweights<-sum(weight[arcs]) } }else{ arcweights<-length(arcs) } result[z]<-arcweights/nweight } result }
19
18 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Second Order Influence Centrality second.order.influence<-function(g,vids,weight=NULL,nodeweight=NULL){ result<-vector('numeric',length(vids)) if(is.null(nodeweight)==FALSE){ nweight<-sum(nodeweight,na.rm=TRUE) }else{ nweight<-vcount(g) } inner<-function(g1,vids2,weight1=weight,n2weight=nweight){ inr<-vector('numeric',length(vids2)) for(z in 1:length(vids2)){ arcs<-incident(g1,vids2[z],'out') if(length(arcs)==0){ next } if(is.null(weight1)==F){ if(is.numeric(weight1)==F){ arcweights<-sum(get.edge.attribute(g1,weight1,arcs)) }else{ arcweights<-sum(weight1[arcs]) } }else{ arcweights<-length(arcs) } inr[z]<-arcweights/n2weight } inr } for(i in 1:length(vids)){ hood<-neighbors(g,vids[i],'out') if(length(hood)==0){ next } result[i]<-sum(inner(g1=g,vids2=hood,weight1=weight,n2weight=nweight)) } result }
20
19 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision KPMG [Link] versus KSU
21
20 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision KPMG [Link] versus KSU First-Order Priestley.26 Bell.24 VanBrackle.24 Yanosky.17 DeMaio.14 Second-Order VanBrackle2.12 Bell1.95 Priestley1.95 Castle1.41 DeMaio1.41
22
21 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision References Ranking of Closeness Centrality for Large-Scale Social Networks, Kazuya Okamoto, Wei Chen, Xiang-Yang Li Krebs, Valdis. "Uncloaking Terrorist Networks" First Monday [Online], Volume 7 Number 4 (1 April 2002) Opsahl, T., Agneessens, F., Skvoretz, J., 2010. Node centrality in weighted networks: Generalizing degree and shortest paths. Social Networks 32 (3), 245-251
23
22 © 2014 KPMG LLP, a Delaware limited liability partnership and the U.S. member firm of the KPMG network of independent member firms affiliated with KPMG International Cooperative ("KPMG International"), a Swiss entity. All rights reserved. Enabled Analytics: The vision Resources The igraph library http://igraph.sourceforge.net/ www.orgnet.com S.N.A.P. http://snap.stanford.edu/snap/index.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.