RWJ Introduction to Networks

October, 11 & 12 2011

 

Powerpoint Files – Just in case you want copies to follow along – these are long, if you print do multiple to a page!.

Part 1 files: rwj_pt1.ppt

Part 2 files: rwj_pt2.ppt

Part 3 files: rwj_pt3.ppt

Part 4 files: rwj_pt4.ppt

 

Workshop Data & Analysis files.

As part of the 2nd day, we will run through a set of example analyses to get a feeling for how to do analyses.  You can follow along as you want.

 

Analysis programs

a)      PAJEK: http://vlado.fmf.uni-lj.si/pub/networks/pajek/

b)      UCINET: http://www.analytictech.com/

c)      The R statistical Package: http://www.r-project.org/

d)      SAS (you must have this from your administrator)

a.       SPAN, suite of sas routines for analyzing nets: http://www.soc.duke.edu/~jmoody77/span/span.zip

 

Data files

            We’ll be working through analyzing data from a school network.  All of the files are derived from the first, though I put the results here just for those who don’t have SAS but do have the other routines.  I write everything w. transport files, just to make moving on the web and such simpler.

 

1)      Creating network data from a Survey.

a.       schldat.xpt  SAS transport file w. base nomination data.

b.      Netcreate.sas.  Program to clean the data and write pajek files

                                                               i.      Sdatcln.xpt  resulting cleaned data

                                                             ii.      Adj_allnoms.net  A PAJEK file with all nominations

1.      adjallnoms_ischl.clu  1=in-school node, 0 = out of sample.

                                                            iii.      Adjis.net  A PAJEK file w. just ‘in school’ nominations

                                                           iv.      A set of partitions for attributes:

1.      adjis_female.clu  1 = female, 0=male

2.      adjis_fights.clu   number of fights in last year

3.      adjis_grade.clu   year in school

4.      adjis_white.clu   1=white, 0 = non-white

 

2)      Peer Influence & Network Behavior Models

a.       Network Structure Models.  Here we use some simple measures on nets to model a behavior outcomes.

                                                               i.      Using files from PAJEK

1.      paj_nodestatread.sas  A file that reads .CLU & .VEC files output by PAJEK into SAS

1.      The PAJEK Files we created

1.      adjis_closeness.vec

2.      adjis_indeg.clu

3.      adjis_outdeg.clu

4.      adjis_totdeg.clu

                                                             ii.      Calculating network structure models in SAS

1.      nodestats1.sas  A program that calculates measures of interest

1.      uses Sdatcln.xpt 

b.      Peer Influence Models

                                                               i.      QAP Models.  Qapstats.sas  moves data from SAS to .NET files that UCINET can read

1.      Resulting files:

1.      amat_qap.net 

2.      samesex_qap.net

3.      samegrade_qap.net

4.      samerace_qap.net

5.      timedif_qap.net

6.      trydif_qap.net

7.      fightdif_qap.net

8.      symnet_qap.net

9.      fight.txt

10.  white.txt

11.  tryhard.txt

                                                             ii.      Peer Influence Models (Network Autocorrelation models)

1.      SAS “QAD” version:  peerinf1.sas

2.      R full ML method

1.      Write data from SAS to R: sas2r_peerinfl.sas

1.      send2r.mac macro for moving data from SAS to R

2.      Resulting files:

1.      edgepi.xpt  (Network edge file)

2.      dycovpi.xpt (network dyad covariate file)

3.      nodespi.xpt (node covariate file)

2.      R scripts

1.      reading the network data: sas2r_lnam.r

2.      running LNAMs: lnam_example.r

3)      Network Structure Models

a.       Clustering Networks

                                                               i.      Simple clustering of distance matrix: dist_clust1.sas

1.      Resulting partition: distclust.clu

                                                             ii.      PAJEK Files for use w. UCINET FACTIONS

1.      Adjis.net

                                                            iii.      Moody “Jiggle” routine

1.      SAS Macros/Modules: Jigfiles.zip

2.      SAS program to run on School data:

b.      Blocking Networks

                                                               i.      Classic CONCOR

                                                             ii.      Moody/White Cohesive-Blocking

1.      Files needed to add to SPAN: kconfiles.zip

2.      Program to run on school data:

c.       Statistical Models for Networks

                                                               i.      Check out tutorials:

1.      STATNET Main page: http://csde.washington.edu/statnet/

2.      STATNET Tutorials: http://csde.washington.edu/statnet/resources.shtml

                                                             ii.      Getting data from SAS to R: statnet_datawrite.sas

1.      Resulting files:

1.      s_edge.xpt

2.      s_dycov.xpt

3.      s_nodes.xpt

4.      sas2statnet1.r (script for reading data)

                                                            iii.      Running some ERGM models

1.      statnet_models.r (script for running example ERGMs)

2.      Saved workspace, since many of the models take too long to run: ergm_exams.RData