Last month I had the wonderful opportunity to help instruct an intensive eight-day workshop on the subject of social network analysis. Affiliated with the Sociology of Education and Science Laboratory at the Higher School of Economics—Saint Petersburg, the workshop sought to recreate the atmosphere of ICPSR summer courses. This workshop was the first of its kind in Russia to offer social networks training as a summer methods course.

Each day the course began with lectures provided by Jeroen Bruggeman (Amsterdam University), followed by applied labs in R taught by Professor Bruggeman and myself (HSE–Moscow), a discussion of the course readings led by Nina O’Brien (University of Southern California), and concluded by student research presentations. The workshop was made possible by Valeria Ivaniushina (HSE—St. Petersburg) and Daniel Alexandrov’s (HSE—St. Petersburg) Sociology of Education and Science Laboratory.

Fortunately for non-attendants, the Laboratory has posted the majority of the workshop’s materials online. I’ll leave it to Bad Hessian’s readership to independently peruse through the readings as well as Professor Bruggeman’s lectures and lab slides.

My own contribution was to run the first half of the R labs. The labs began with an introduction to R’s basic functions and concluded with CUG and QAP tests. I designed the labs with the assumption that most students were unfamiliar with both R and the sna package. The outline of the labs is as follows:

  1. Familiarity with R.  Covers R history, basic usage, and data types.
  2. Networks & R.  Continues the previous lab and covers data importation and conversion from edge lists to matrices.
  3. Plotting Networks in R.  Covers the usage of gplot(), incorporating attributes into visualizations, converting data from two-mode to one-mode networks, setting thresholds for valued networks, and saving coordinates.
  4. Graph-Level Indexes.  Reviews global network properties like density, mutuality, dyad censuses, triad censuses, transitivity, network components, and diameter.
  5. Random Network Comparisons. Introduction to creating random networks and baseline effects, CUG and QAP hypothesis tests, centrality, and centralization.
  • Adam Slez

    Very cool! A quick scan suggests that most of this is being done in sna. I used sna exclusively until about a month ago when I ran into some unexpected issues with both plotting and blockmodeling at which point I started working a bit more with igraph. What are your thoughts on the strengths and weaknesses of the two?

    • Thanks. My lab slides were in sna, while Jeroen’s were in igraph. I haven’t used igraph much beyond the workshop. It seems like the packages have two different motivations. sna seems to work better with other packages (it feels quite natural in R) and has the advantage of being included with the statnet suite (by way of the “network” package). igraph seems somewhat walled in, as (I believe) the network data it uses can only be readily used within igraph. However, the latest update to igraph was a big improvement that included a number of major changes to meet conventional standards in R. (Like beginning indexes with 1 instead of 0.)

      It seems that there’s something of a different network tradition behind them as well. sna is an older package initially designed to bring the functionality of UCINET into R. I’ve heard here and there it has a few bugs, but it handles most traditional network methods quite well. On the other hand, igraph is a much newer package and implements some of the more recent “network science” methods and measures popularized by scholars outside of the social sciences. Personally, I learned most network methods off of the sna package, so it’s the one I’ll continue to go to for traditional methods and measurements.

      I’m not sure about how the compare in terms of time performance, though, other than large matrix objects will likely slow down sna.

      • Adam Slez

        Good point about data formats. It is easy enough to get igraph to kick things back in other formats using the conversion command. As I see it, the big upside for sna on this front is its ability to work directly with things like standard matrix-class objects.

        I’ve only just started getting into the community detection literature, but it was nice to see that a lot of this stuff is already up and running in igraph.

        • Yeah, community detection is one point that igraph does quite well. I think it also has more recent centrality measures, too. I also like igraph’s network formation “games.” I’m growing more and more skeptical of using Erdős–Rényi models for baseline comparisons, so it’s nice to see other random graph models readily available. That said, the ergm package is where it’s at for custom random graph generation.

  • Pingback: International Summer School on Social Network Analysis: Introduction and Methods of Analysis in R « Bad Hessian()