data have;
infile datalines truncover dsd;
input companyid $ awarddate:date9. directorid $;
format awarddate date9.;
datalines;
111,01jan2017,0001
111,01jan2018,0002
111,01jan2018,0003
111,01jan2023,0004
111,01jan2023,0005
111,01jan2023,0006
222,01jan2023,0007
222,01jan2023,0008
; Hi Patric, Sorry for providing without specific data set, and make you misunderstand the question. I will use the data set you provide and try to explain it one more time. 1. Companyid is the school the directors attain. 2. Awarddate is the date they graduated. 3. Every director has a unique directorid so every ID will be different. To make a social ties, if two director graduated in same school within one year and share the same companyid, then the ED dummy will be one. For example, director 0001 and 0002 have social ties (They attain same school and Director 0001 graduation period 01Jan2016~01Jan2017 overlap Director 0002 graduation period 01Jan2017~01Jan2018 on 01Jan2017); Director 0004 and Director 0005 have social ties because their graduate period have overlapped and graduate in same school. The final form will be like this screenshot. The solution you provide before is pretty good! You are so smart and kind. Thanks for your help.
... View more