/* this program reads in some data created by PAJEK on the school net and then runs a *very simple* model using that data */ libname in1xpt xport 'c:\jwm\conferences\columbia\workshop\sdatcln.xpt'; /* bring in the base school data */ data sdat; set in1xpt.sdatcln; run; /* now read in the data from the PAJEK files */ data totdeg; infile 'c:\jwm\conferences\columbia\workshop\adjis_totdegree.clu'; input totdeg; if totdeg = . then delete; /* removes the header line */ run; data indeg; infile 'c:\jwm\conferences\columbia\workshop\adjis_indeg.clu'; input indeg; if indeg = . then delete; /* removes the header line */ run; data outdeg; infile 'c:\jwm\conferences\columbia\workshop\adjis_outdeg.clu'; input outdeg; if outdeg = . then delete; /* removes the header line */ run; data closeness; infile 'c:\jwm\conferences\columbia\workshop\adjis_closeness.vec'; input closeness; if closeness = . then delete; /* removes the header line */ run; /* merge them. NOTE NO BY STATEMENT. We rest purely on the sort order... */ data sdat; merge sdat totdeg indeg outdeg closeness; run; /* just plot the stats quickly to look */ proc univariate data=sdat noprint; histogram totdeg indeg outdeg closeness / cfill=red; inset mean="Mean" std="STD"; run; symbol value=circle i=rl; proc gplot data=sdat; plot closeness * totdeg ; run; quit; proc gplot data=sdat; where closeness > 0; plot closeness * totdeg ; run; quit; /* now run a simple behavioral model. I'm going to model number of fights in the last year as a function of centrality. */ data sdat; set sdat; isolate=0; if totdeg = 0 then isolate=1; run; proc logistic descending data=sdat; model s64 = female s3 white isolate ; run; quit; proc logistic descending data=sdat; model s64 = female s3 white outdeg; run; quit; proc logistic descending data=sdat; model s64 = female s3 white indeg; run; quit; proc logistic descending data=sdat; model s64 = female s3 white totdeg; run; quit; proc logistic descending data=sdat; model s64 = female s3 white closeness; run; quit; /* results suggest that both closeness & isolate matter, but they are too colinear to run together. Let's look at closeness beyond isolation */ proc logistic descending data=sdat; where isolate=0; model s64 = female s3 white closeness; run; quit; /* suggests nothing going on here beyond isolation ... */