<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>social networks | Chen Xing</title>
    <link>https://chenxing.space/tag/social-networks/</link>
      <atom:link href="https://chenxing.space/tag/social-networks/index.xml" rel="self" type="application/rss+xml" />
    <description>social networks</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Fri, 24 Nov 2023 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://chenxing.space/media/sharing.png</url>
      <title>social networks</title>
      <link>https://chenxing.space/tag/social-networks/</link>
    </image>
    
    <item>
      <title>Learning Resource: Social Network Analysis</title>
      <link>https://chenxing.space/blog/learning-resource-social-network-analysis/</link>
      <pubDate>Fri, 24 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://chenxing.space/blog/learning-resource-social-network-analysis/</guid>
      <description>&lt;div class=&#34;alert alert-tip&#34;&gt;
  &lt;div&gt;
    Check out &lt;code&gt;igraph&lt;/code&gt; R-package 📦!
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;summary-of-concepts&#34;&gt;Summary of Concepts&lt;/h2&gt;
&lt;p&gt;See my notes in “Analyzing Social Media Networks with NodeXL: Insights from A Connected World” (Hansen et al. 2019), Chapter 3 Sections 3.1-3.5 (pages 31-42).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Node&lt;/strong&gt;: Represents an entity (e.g., individual, organization) within the network.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Edge&lt;/strong&gt;: Connects two nodes, symbolizing a relationship or interaction.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Graph&lt;/strong&gt;: The entire structure comprising nodes and edges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Degree&lt;/strong&gt;: Number of connections for a node, with in-degree and out-degree in directed networks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Path&lt;/strong&gt;: Sequence of edges linking two nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Centrality&lt;/strong&gt;: Quantifies the importance of nodes.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Degree Centrality: Frequency of a node in the network.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Betweenness Centrality: Frequency of a node appearing on shortest paths between other nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Closeness Centrality: Proximity of a node to all other nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Eigenvector Centrality: Influence level of a node.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Diameter&lt;/strong&gt;: Longest shortest path within the network.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Community&lt;/strong&gt;: Nodes more densely connected to each other than to the rest of the network.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Homophily&lt;/strong&gt;: Tendency to connect with similar others.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Structural Holes&lt;/strong&gt;: Gaps offering strategic advantages in information flow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Social Capital&lt;/strong&gt;: Benefits and resources accessible through social networks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Small-world Network&lt;/strong&gt;: Characterized by short path lengths and high clustering.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scale-free Network&lt;/strong&gt;: Features a power-law degree distribution with few highly connected nodes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Network Density&lt;/strong&gt;: Proportion of actual connections to potential connections.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Modularity&lt;/strong&gt;: Strength of a network’s division into modules or communities.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;summary-table&#34;&gt;Summary Table&lt;/h3&gt;
&lt;p&gt;The following summary table is from (Kane et al. 2014).&lt;/p&gt;
&lt;img src=&#34;https://raw.githubusercontent.com/chenx2018/blogdown-image/main/uPic/image-20231126085650887.png&#34; alt=&#34;image-20231126085650887&#34; style=&#34;zoom:50%;&#34; /&gt;
&lt;h3 id=&#34;understanding-the-role-of-random-graphs-in-network-analysis&#34;&gt;Understanding the Role of Random Graphs in Network Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Contextual Analysis of Network Metrics:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Random graphs help in evaluating the significance of network metrics by providing a comparison point.&lt;/li&gt;
&lt;li&gt;This approach determines if observed network patterns are typical or atypical under certain conditions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assessing Significance and Likelihood:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;By comparing real network characteristics to those of random graphs, it’s possible to assess the likelihood of these characteristics occurring by chance.&lt;/li&gt;
&lt;li&gt;Significant differences in metrics like clustering suggest underlying social processes, not just random formation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Baseline for Comparison (Null Model):&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;A random graph acts as a baseline, representing a network where connections are formed randomly.&lt;/li&gt;
&lt;li&gt;Comparing real networks to this baseline identifies non-random, significant features of the network.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;alert alert-tip&#34;&gt;
  &lt;div&gt;
    &lt;p&gt;Randomization tests enable you to identify:&lt;/p&gt;
&lt;p&gt;Whether features of your original network are particularly unusual.&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Simplicity in Modeling:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;The simplest random graph mirrors the original graph in terms of number of nodes and density, facilitating easier statistical analysis.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Methodological Rigor:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Utilizing random graphs adds rigor and depth to network analysis.&lt;/li&gt;
&lt;li&gt;It aids in discerning meaningful social network patterns from those that might arise randomly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This summary encapsulates the importance of using random graphs in social network analysis, particularly for understanding the significance and context of various network properties and metrics.&lt;/p&gt;
&lt;h2 id=&#34;datacamp-course-notes-key-functions-in-igraph&#34;&gt;Datacamp course notes: key functions in &lt;code&gt;igraph&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Chapter 1: Basic Network Analysis&lt;/p&gt;
&lt;p&gt;Creating and Visualizing Graphs&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create Graph&lt;/strong&gt;: &lt;code&gt;graph.edgelist(as.matrix(df), directed = FALSE)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vertices and Edges&lt;/strong&gt;: &lt;code&gt;V(g)&lt;/code&gt;, &lt;code&gt;E(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Graph Order and Size&lt;/strong&gt;: &lt;code&gt;gorder(g)&lt;/code&gt;, &lt;code&gt;gsize(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plot Graph&lt;/strong&gt;: &lt;code&gt;plot(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Attributes&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Add Vertex Attributes&lt;/strong&gt;: &lt;code&gt;set_vertex_attr(g, &amp;quot;attribute&amp;quot;, value)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get Vertex Attributes&lt;/strong&gt;: &lt;code&gt;vertex_attr(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add Edge Attributes&lt;/strong&gt;: &lt;code&gt;set_edge_attr(g, &amp;quot;attribute&amp;quot;, value)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get Edge Attributes&lt;/strong&gt;: &lt;code&gt;edge_attr(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Subsetting and Coloring&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Subsetting Networks&lt;/strong&gt;: &lt;code&gt;E(g)[[.inc(&#39;vertex&#39;)]]&lt;/code&gt;, &lt;code&gt;E(g)[[condition]]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coloring Vertices&lt;/strong&gt;: &lt;code&gt;V(g)$color &amp;lt;- ifelse(condition, &amp;quot;color1&amp;quot;, &amp;quot;color2&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Layouts&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Graph Layouts&lt;/strong&gt;: &lt;code&gt;plot(g, layout = layout.fruchterman.reingold(g))&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Chapter 2: Advanced Network Analysis Techniques&lt;/p&gt;
&lt;p&gt;Directionality and Degrees&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Check Directionality&lt;/strong&gt;: &lt;code&gt;is.directed(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Degree Analysis&lt;/strong&gt;: &lt;code&gt;degree(g, mode = c(&amp;quot;out&amp;quot;))&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Neighbors&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identify Neighbors&lt;/strong&gt;: &lt;code&gt;neighbors(g, &amp;quot;vertex&amp;quot;, mode = c(&amp;quot;mode&amp;quot;))&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Common Neighbors&lt;/strong&gt;: &lt;code&gt;intersection(x, y)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Paths&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Longest Paths&lt;/strong&gt;: &lt;code&gt;farthest_vertices(g)&lt;/code&gt;, &lt;code&gt;get_diameter(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ego Networks&lt;/strong&gt;: &lt;code&gt;ego(g, N, &#39;vertex&#39;, mode=c(&#39;mode&#39;))&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Importance Measures&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Betweenness&lt;/strong&gt;: &lt;code&gt;betweenness(g, directed = TRUE, normalized = TRUE)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other Measures&lt;/strong&gt;: &lt;code&gt;degree&lt;/code&gt;, &lt;code&gt;eigenvector centrality&lt;/code&gt;, &lt;code&gt;closeness centrality&lt;/code&gt;, &lt;code&gt;pagerank centrality&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Chapter 3: Network Metrics and Random Graphs&lt;/p&gt;
&lt;p&gt;Centrality and Density&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Eigenvector Centrality&lt;/strong&gt;: &lt;code&gt;eigen_centrality(g)$vector&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network Density&lt;/strong&gt;: &lt;code&gt;edge_density(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Path Length and Random Graphs&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Average Path Length&lt;/strong&gt;: &lt;code&gt;mean_distance(g, directed = FALSE)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Random Graphs&lt;/strong&gt;: &lt;code&gt;erdos.renyi.game(n, p.or.m, type)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Transitivity&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Transitivity&lt;/strong&gt;: &lt;code&gt;triangles(g)&lt;/code&gt;, &lt;code&gt;transitivity(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local Transitivity&lt;/strong&gt;: &lt;code&gt;transitivity(g, vids = &#39;vertex&#39;, type = &amp;quot;local&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cliques&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identifying Cliques&lt;/strong&gt;: &lt;code&gt;largest_cliques(g)&lt;/code&gt;, &lt;code&gt;max_cliques(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Chapter 4: Community Detection and Visualization&lt;/p&gt;
&lt;p&gt;Assortativity and Reciprocity&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Assortativity&lt;/strong&gt;: &lt;code&gt;assortativity(g, values)&lt;/code&gt;, &lt;code&gt;assortativity.degree(g, directed = FALSE)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reciprocity&lt;/strong&gt;: &lt;code&gt;reciprocity(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Community Detection&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast-Greedy Detection&lt;/strong&gt;: &lt;code&gt;fastgreedy.community(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Edge-Betweenness Detection&lt;/strong&gt;: &lt;code&gt;edge.betweenness.community(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Community Analysis&lt;/strong&gt;: &lt;code&gt;length(x)&lt;/code&gt;, &lt;code&gt;sizes(x)&lt;/code&gt;, &lt;code&gt;membership(x)&lt;/code&gt;, &lt;code&gt;plot(x, g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Visualization&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visualization Packages&lt;/strong&gt;: &lt;code&gt;igraph&lt;/code&gt;, &lt;code&gt;visNetwork&lt;/code&gt;, &lt;code&gt;statnet&lt;/code&gt;, &lt;code&gt;networkD3&lt;/code&gt;, &lt;code&gt;ggnet&lt;/code&gt;, &lt;code&gt;sigma&lt;/code&gt;, &lt;code&gt;ggnetwork&lt;/code&gt;, &lt;code&gt;rgexf&lt;/code&gt;, &lt;code&gt;ggraph&lt;/code&gt;, &lt;code&gt;threejs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Threejs Visualization&lt;/strong&gt;: &lt;code&gt;library(threejs)&lt;/code&gt;, &lt;code&gt;graphjs(g)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Adding Attributes&lt;/strong&gt;: &lt;code&gt;set_vertex_attr(g, &amp;quot;label&amp;quot;, value = V(g)$name)&lt;/code&gt;, &lt;code&gt;set_vertex_attr(g, &amp;quot;color&amp;quot;, value = &amp;quot;color&amp;quot;)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coloring Communities&lt;/strong&gt;: &lt;code&gt;x = edge.betweenness.community(g)&lt;/code&gt;, &lt;code&gt;i &amp;lt;- membership(x)&lt;/code&gt;, &lt;code&gt;set_vertex_attr(g, &amp;quot;color&amp;quot;, value = c(&amp;quot;color1&amp;quot;, &amp;quot;color2&amp;quot;, &amp;quot;color3&amp;quot;)[i])&lt;/code&gt;, &lt;code&gt;graphjs(g)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;useful-resource&#34;&gt;Useful resource&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;datacamp “Network Analysis in R”.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;YouTube tutorial &lt;a href=&#34;https://www.youtube.com/playlist?list=PL1M5TsfDV6VsyfMHfkDcUW71ADKcUNCUI&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Social Network Analysis: A Beginner’s Lab in R&lt;/a&gt; provided by Duke University Network Analysis Center.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Textbook: “Statistical Analysis of Network Data with R” by Eric D. Kolaczyk (Kolaczyk and Csárdi 2014).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;alert alert-tip&#34;&gt;
  &lt;div&gt;
    Use index to check definitions and concepts of network and R coding.
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Please check out &lt;a href=&#34;https://r.igraph.org/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;R package: igraph&lt;/a&gt;. If you need to know how to compute a particular attribute of the network, the &lt;a href=&#34;https://r.igraph.org/reference/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;reference page&lt;/a&gt; is a good starting point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are many packages available to make network plots. One very useful one is &lt;code&gt;threejs&lt;/code&gt; which allows you to make interactive network visualizations. This package also integrates seamlessly with &lt;code&gt;igraph&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;reference&#34;&gt;Reference&lt;/h2&gt;
&lt;div id=&#34;refs&#34; class=&#34;references csl-bib-body hanging-indent&#34; entry-spacing=&#34;0&#34;&gt;
&lt;div id=&#34;ref-9780128177570&#34; class=&#34;csl-entry&#34;&gt;
&lt;p&gt;Hansen, Derek, Ben Shneiderman, Marc A. Smith, and Itai Himelboim. 2019. &lt;em&gt;Analyzing Social Media Networks with NodeXL&lt;/em&gt;. Morgan Kaufmann.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;ref-KaneUnknownTitle2014&#34; class=&#34;csl-entry&#34;&gt;
&lt;p&gt;Kane, Gerald C., and Maryam Alavi, Giuseppe (Joe) Labianca, Stephen P. Borgatti, and and and. 2014. “What’s Different about Social Media Networks? A Framework and Research Agenda.” &lt;em&gt;MIS Quarterly&lt;/em&gt;. &lt;a href=&#34;https://doi.org/10.25300/misq/2014/38.1.13&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://doi.org/10.25300/misq/2014/38.1.13&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;ref-1493909827&#34; class=&#34;csl-entry&#34;&gt;
&lt;p&gt;Kolaczyk, Eric D., and Gábor Csárdi. 2014. &lt;em&gt;Statistical Analysis of Network Data with r&lt;/em&gt;. Springer.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>
