Calculating individuals social network connections using data from BoardEx

Reply
Contributor
Posts: 37

Calculating individuals social network connections using data from BoardEx

Hello Everyone

 

I'm a new user and your assistance would be very much appreciated.

 

I'm a trying to calculate CEOs social connections using data from BoadEx specifically CEOs educational networks, past employment networks and other activities networks. However, the codes I have tried so far don't work. 

 

Is there any available codes in SAS to estimate these social networks measures of individuals in boadex database?

 

Thank you very much for the assistance. 

Valued Guide
Posts: 2,177

Re: Calculating individuals social network connections using data from BoardEx

More detail needed (metadata about sources)
Contributor
Posts: 37

Re: Calculating individuals social network connections using data from BoardEx

BoardEx database (http://corp.boardex.com/data/), contains biographical information on the senior executives and board members of public and private firms. For each director or executive, BoardEx compiles a full historical profile containing the past employment history, current employment, board memberships, educational background, and social activities such as memberships in social and charitable organizations.

 

I want to measure a CEO network size by counting the number of executives or directors on the annual network with whom the CEO has connections. I define a CEO network connection as one established between a CEO and another individual if they link on one or more of employment, education, or other activities (e.g., social club). For instance,two individuals are connected via employment if their careers overlap with the same employer in the same year. 

 

Sample of data attached. 

 

Thanks for the assistance. 

 

 


edu.PNGemployment.PNGother.PNG
Super User
Posts: 7,809

Re: Calculating individuals social network connections using data from BoardEx

Posting data in pictures is not helpful. Use the macro provided here to convert your datasets to datasteps you can post here ("little running man" button)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 37

Re: Calculating individuals social network connections using data from BoardEx

Posted in reply to KurtBremser

Thanks for the guidelines

 

Please attached is a sample of directors/individuals educational background from the entire sample. I want to estimate the educational connections among individuals. Thus when two individuals are connected through educational networks if they graduated within a year from the same university and have the same degree type. 

 

Thanks for the assistance.

Super User
Posts: 7,809

Re: Calculating individuals social network connections using data from BoardEx

Please read my post again, carefully. Excel files are useless as example data, for a lot of reasons. Please post your data in a datastep, as described in the link I gave you.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 37

Re: Calculating individuals social network connections using data from BoardEx

Posted in reply to KurtBremser

Hello KurtBremser

 

I have tried several times to put my data in a datastep as directed but still not working for me. 

 

Any further directions for me...Am still trying to find my way as a new user.

 

Thanks.  

Super User
Posts: 7,809

Re: Calculating individuals social network connections using data from BoardEx

Where did you fail?

- downloading the zip?

- extracting the .sas from the zip?

- opening the .sas in your SAS environment?

- running the macro as documented?

- finding and loading the resulting .sas file?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 37

Re: Calculating individuals social network connections using data from BoardEx

Posted in reply to KurtBremser

Please KurtBremer thank you very much. 

 

However, when i copy the macro and run after making the neccessary changes. Please this the error i keep getting. 

 

I have no clue how to fix this problem after several trials of fixing it. Thanks once again for the further direction

 

817 %macro data2datastep(edu,networks,,5);
ERROR: Invalid macro parameter name ,. It should be a valid SAS identifier no longer than 32
characters.
ERROR: A dummy macro will be compiled.
818 %local varlist msgtype;
819
820 %if %superq(obs)= %then %let obs=MAX;
821
822 %let msgtype=NOTE;
823 %if %superq(dsn)= %then %do;
824 %let msgtype=ERROR;
825 %put &msgtype: You must specify a data set name;
826 %put;
827 %goto syntax;
828 %end;
829 %let dsn=%qupcase(%superq(dsn));
830 %if %superq(dsn)=!HELP %then %do;
831 %syntax:
832 %put &msgtype: &SYSMACRONAME macro help document:;
833 %put &msgtype- Purpose: Converts a data set to a SAS DATA step.;
834 %put &msgtype- Syntax: %nrstr(%%)&SYSMACRONAME(dsn<,lib,file,obs>);
835 %put &msgtype- dsn: Name of the dataset to be converted. Required.;
836 %put &msgtype- lib: LIBREF where the dataset resides. Optional.;
837 %put &msgtype- file: Fully qulaified filename for the DATA step produced. Optional.;
838 %put &msgtype- Default is %nrstr(create_&lib._&dsn._data.sas) in the SAS default
838! directory.;
839 %put &msgtype- obs: Max observations to include the created dataset. Optional.;
840 %put &msgtype- Default is MAX (all observations);
841 %put;
842 %put NOTE: &SYSMACRONAME cannot be used in-line - it generates code.;
843 %put NOTE- Use !HELP to print these notes.;
844 %return;
845 %end;
846
847 %if %superq(lib)= %then %do;
848 %let lib=%qscan(%superq(dsn),1,.);
849 %if %superq(lib) = %superq(dsn) %then %let lib=WORK;
850 %else %let dsn=%qscan(&dsn,2,.);
851 %end;
852 %let lib=%qupcase(%superq(lib));
853 %let dsn=%qupcase(%superq(dsn));
854
855 %if %sysfunc(exist(&lib..&dsn)) ne 1 %then %do;
856 %put ERROR: (&SYSMACRONAME) - Dataset &lib..&dsn does not exist.;
857 %let msgtype=NOTE;
858 %GoTo syntax;
859 %end;
860
861 %if %superq(file)= %then %do;
862 %let file=create_&lib._&dsn._data.sas;
863 %if %symexist(USERDIR) %then %let file=&userdir/&file;
864 %end;
865
866 %if %symexist(USERDIR) %then %do;
867 %if %qscan(%superq(file),-1,/\)=%superq(file) %then
868 %let file=&userdir/&file;
869 %end;
870
871 proc sql noprint;
872 select Name
873 into :varlist separated by ' '
874 from dictionary.columns
875 where libname="&lib"
876 and memname="&dsn"
877 ;
878 select case type
879 when 'num' then
880 case
881 when missing(format) then cats(Name,':32.')
882 else cats(Name,':',format)
883 end
884 else cats(Name,':$',length,'.')
885 end
886 into :inputlist separated by ' '
887 from dictionary.columns
888 where libname="&lib"
889 and memname="&dsn"
890 ;
891 quit;
892
893 data _null_;
894 file "&file" dsd;
895 if _n_ =1 then do;
896 put "data &lib..&dsn;";
897 put @3 "infile datalines dsd truncover;";
898 put @3 "input %superq(inputlist);";
899 put "datalines4;";
900 end;
901 set &lib..&dsn(obs=&obs) end=last;
902 put &varlist @;
903 if last then do;
904 put;
905 put ';;;;';
906 end;
907 else put;
908 run;
909 %mend;

 

Super User
Posts: 7,809

Re: Calculating individuals social network connections using data from BoardEx

Everything from %macro to %mend is the macro definition and must not be altered.

You then call the macro with %data2datastep(edu,networks,,5)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Valued Guide
Posts: 2,177

Re: Calculating individuals social network connections using data from BoardEx

817 %macro data2datastep(edu,networks,,5);

In this, beginning the macro definition, you must not have consecutive commas - that would imply a parameter with no name
Ask a Question
Discussion stats
  • 10 replies
  • 316 views
  • 0 likes
  • 3 in conversation