Folks,
Would anyone be able to provide some helpful code as to how I can visualize different relationships between individuals please? Below is some sample data I generated.
data sample;
infile datalines delimiter='';
input Person_1 $8. Person_2 $9.;
datalines;
1099161F 0271089L
1099161F
1099161F 0924825s
021089L 1099161F
021089L 0325554F
0924820s
0924820s 1099161F
0924820s 0117054L
0924820s 0109356P
0325547F
0325547F 0271089L
0325547F 0104321G
0117674L 0924825s
0179356P
0179356P 0924825s
0104321G 0623501A
0104321G 0402209W
0104321G 0321259U
0104321G 0325554F
0104321G 0578954G
0104321G 0714189P
0104321G 0598079Q
0104321G 0550380P
0104321G 0623650A
0104321G 0402209W
0104321G 0272590U
0104321G 0325547F
0104321G 0578954G
0104321G 0716441j
;run;
Any kind of advice as to how to generate a relationship network graph would be very helpful.
You can accomplish this with PROC SGPLOT and a bit of data prep.
First, you'll need to reorganize your data into a series of nodes (thinking of each person as a numbered node) and the position of each node. Then you need records that show which nodes link to each other. Usually this requires two data sets: one with the nodes, and one with the links.
See this article: Diagrams with Curved Links
Or, for another idea, see this article.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.