*file called influence1.sas in the influence directory; *This makes the new influence variables from pstar.list and pblfs.list; LIBNAME LIBREF "c:\myfiles\courses\seminar\seminar\software."; libname in1 "c:\myfiles\mtip\2002 study\"; libname libs "c:\myfiles\courses\seminar\seminar\software."; options nocenter; options linesize=120; options pagesize=58; options linesize=78; *an alternative way of creating differences in attitudes; title "diffattb, differences in attitudes using proc means"; data blfsdat; infile "c:\myfiles\courses\seminar\seminar\software\yvar.list"; input person1 person2 yvar; *note to make sure the ids are identical, use the following; person2=person1; data justip; set blfsdat; yvarip=yvar; label yvarip =" y variable for person i prime"; drop yvar person1; proc sort; by person2; data justi; set blfsdat; yvari=yvar; label yvari =" y variable for person i"; drop yvar person2; proc sort; by person1; * read in network data; data netdat; infile "c:\myfiles\courses\seminar\seminar\software\influence.list"; input person1 person2 relate; label relate="extent of relationship between person1 and person2"; if person1 ne person2; if person2 ne 99999; proc sort; by person1 person2; *next 20 lines, through allid, are to make a data set with allid's; proc means noprint data=blfsdat; var person1; output out=withmax max=maxid; data inmax; set withmax; file "c:\myfiles\courses\seminar\seminar\software\allid.dat"; do person1 =1 to maxid; do person2 =1 to maxid; if person1 ne person2 then put (person1 person2) (10.); end; end; data allid; infile "c:\myfiles\courses\seminar\seminar\software\allid.dat"; input person1 person2; proc sort; by person1 person2; data kendat; merge allid netdat; by person1 person2; *the whole point of allid was to figure out the relate values that were 0, as below; if relate=. then relate=0; *ready to merge with justip; proc sort; by person2; data withip; merge kendat justip; by person2; proc print; run; proc sort; by person1; data libref.withboth; merge withip justi; by person1; diffatt=abs(yvarip-yvari); *note here you could also make a variable called samey; samey=0; if yvarip=yvari then samey=1; label diffatt="absolute value of difference in attitude" samey = " same on yvar or not"; proc sort; by person1 person2; proc print; run;