Forming Portfolio of Connected firms

Reply
Contributor
Posts: 37

Forming Portfolio of Connected firms

Hi All

 

I have daily stock price  data for 1000 firms. I need to form portfolios of firms that are connected to each other. For instance in my sample data attached, firm with Permno number 10001 is connected to firms with permno number 1002, 1009,10012,10019. I want to form a portfolio consisting of these four firms (1002, 1009,10012,10019) that are connected to firm 10001. How do i resolve this problem. Thanks in advance for the assitance. rgds ejaa. 

Super Contributor
Posts: 298

Re: Forming Portfolio of Connected firms

How do you know the connection, do you have them in another file?

 

Otherwise you could create a group data set which contains group and firms and then join that data set with your details.

After that it is easy to summarize or whatever you want Smiley Happy

 

data groups;

  length group firm $32;

 input group firm;

 datalines;

 group1 10001

 group1 10002

group1 10003

group2 11001

group2 11002

....

....

;

run;

 

proc sql;

 create jointV as

  select * from groups as a

  left join details as b

 on a.firm = b.permno

 ;

quit;

 

//Fredrik

Contributor
Posts: 37

Re: Forming Portfolio of Connected firms

Hi Fredrike

With reference to the connections, yes i do have them on a different sheet. Thus each firm and the firms connected to it. Thanks

Super Contributor
Posts: 298

Re: Forming Portfolio of Connected firms

Have you tried my code example?

Can you provide some of your tries, and maybe an example of what you want to accomplish Smiley Happy

//Fredrik

Regular Contributor
Posts: 195

Re: Forming Portfolio of Connected firms

You need the connections between firms stored in a file, without that information solving the problem ist hardly possible. Or does any logic exist to identify the connection?
Contributor
Posts: 37

Re: Forming Portfolio of Connected firms

Posted in reply to error_prone

Hi error_prone

I have the connections among firms established using a set of rules hence me been able to indicate that firm 10001 in the attached sample  is connected to four firms in the data. So for each firm, I have on all other firms connected to it and want to create a portfolio for the connected firms using daily prices which is proving difficult. Thanks. 

Contributor
Posts: 37

Re: Forming Portfolio of Connected firms

Posted in reply to error_prone

I have the connections stored in another file. I want to read from the two data sets to create the groups/connected firms. any directions for me. thanks in advance.rgds

Ask a Question
Discussion stats
  • 6 replies
  • 135 views
  • 0 likes
  • 3 in conversation