Friday, September 14, 2012

A Love Hate Relationship with R is Born

I am interested in arms transfers.  I am also interested in networks. In my dissertation I am combining those two interests.  I think that I am looking at some really cool relationships.  This is well and good. However, to do this fun research stuff I have had to leave my comfort zone of STATA and work in R.  Now I am fighting through the twin troubles of learning new software (and a language to code in) and learning new models.

I did a preliminary round of study to make sure that I could do this analysis in an advanced statistics class last semester.  Over the summer R changed versions. The package I use to do my ERGM analysis broke.  That package was updated.  Then my code broke and nothing worked the past two weeks as I have tried to get my analysis done for my dissertation.

After hours of frustrated Googling, I found a note on a blog (that I can't find a link to now... arrrrrgh!) about R namespaces and needing to remove the igraph and statnet packages and reinstall statnet first in order for it to work correctly.  I did this (without reinstalling igraph, just to be sure).  Now things run.  Now I can actually do analysis and not debugging and firefighting with the software.

Enough of the hate. I love Rstudio.  After running through some model specifications last night I decided to try out the knitr package. Awesome.  I still have a lot to learn to make things into real good documents and documentation of my analyses, but you can check out this link to my output for my test models here.

And here is a network graph of France's (egocentric) arms network during the 1950s.  The network is created from the main world network.  The world network accounts for all arms transactions from 1950 to 1959.  The sociomatrix shows a 1 if state i sold weapons to state j at any point during the 10 year window.
Created Using R. Data come from SIPRI.

No comments:

Post a Comment