R 1

For me, R is the perfect language for data manipulation, processing, visualization, statistical computation, and machine learning. I primarily use R for social network analysis. I have replicated two empirical studies using R and built various types of networks, such as trade networks, co-authorship networks, and executive alumni relationship networks, to propose relevant indicators. Additionally, with the help of R’s MplusAutomation package, I am able to perform all analysis related to Structural Equation Modeling (SEM).

  1. This R code performs an in-depth analysis of trade networks from 2005 to 2015. Initially, it constructs directed graphs for each year using the igraph library and computes various metrics for network density, node degree, and node strength over time. It generates plots to visualize the changes in these statistics, such as the average node degree and strength, as well as the corresponding standard deviations; Additionally, the code explores centrality measures, clustering coefficients, and their correlations with node degree and node strength. It visualizes these correlations using both standard plots and kernel density plots, highlighting the structural evolution of the trade networks. Finally, the code examines the relationship between clustering coefficients and degree/strength in 2015, using log-transformed data and linear regression models to understand their interaction, offering insights into the clustering behavior of the network’s nodes.
  1. This code conducts an extensive analysis of trade networks from 2005 to 2016. Initially, it loads trade network data for each year, creating directed graphs for each dataset. The code calculates several network metrics for each year, including node degree, node strength, graph density, closeness, betweenness, and various centrality measures. The code visualizes trends in these indicators over the 11 years, highlighting significant fluctuations in node strength, degree distribution, and clustering. It also calculates transitivity and uses various layouts (e.g., Kamada-Kawai, Fruchterman-Reingold) to visualize the network structure for specific years (e.g., 2016), illustrating changes in core-periphery structures and the role of hubs (key trading nations). Finally, the code highlights the network hubs and nodes with high authority and strength using node size and layout adjustments, offering a comprehensive visual and quantitative assessment of the trade network dynamics.
滚动至顶部