BookmarkSubscribeRSS Feed
EJAA
Obsidian | Level 7

Hi All, 

 

Thanks in advance for your help.

 

I am trying to run a matched pair regression across companies using data in two different table. I have about 9700 firms in one data set (help1) and in another  data set (help) which contains a list of firms connected to each of the 9700 firms. Sample of data is attached.

From the 2 tables below, company with lpermno 10001 in table Help1 is connected to company 8433 and 1723398 as shown in table Help.

 

In the end, I want run a pair regression where I regress volume of company with lpermno 10001 on volume  and stk_returns of firm 8433 and do same for other companies connected to firm wth ID 10001. Thus I want to do same for company 10001 and 1723398...etc

 

In brief, I run regression for 10001 and 8433; and 10001 and 1723398 by regressing volume of firm 10001 on volume and stk_returns of firm 8433. Each company is connected to several other companies hence seeking for your help to run the regressions at a go.

 

Data set “help1” contains daily volume and skt_returns for 9700 firms.

CompanyID   lpermno           date              volume           stk_returns
10675            10001           01/03/2000        142                     0.40
10675            10001           01/04/2000         245                    0.45         
10675            10001            01/05/2000        285                    0.42
10675            10001           01/07/2000        181                    0.43      

10675            10001           01/10/2000        149                     0.44
620983         10002           01/03/2000        200                     0.30
620983         10002           01/04/2000         280                    0.35         
620983         10002            01/05/2000        230                    0.32
620983         10002           01/07/2000        190                    0.33      

620983         10002           01/10/2000        240                      0.34

8433             10003           01/03/2000        300                     0.10
8433             10003           01/04/2000         380                    0.15         
8433             10003           01/05/2000        330                    0.12
8433             10003           01/07/2000        390                    0.13      

8433             10003           01/10/2000        340                     0.14

576969          10004          01/03/2000        400                     0.80
576969          10004           01/04/2000         480                    0.85         
576969          10004           01/05/2000        430                    0.82
576969          10004           01/07/2000        490                    0.83      

576969          10004           01/10/2000        440                     0.84

1723398          10000          01/03/2000        500                     0.60
1723398          10000           01/04/2000       580                    0.65         
1723398          10000           01/05/2000        530                    0.62
1723398         10000           01/07/2000        590                    0.63      

1723398         10000           01/10/2000       500                     0.64

 

Data set “help” contains the number of firms connected to each firm.d1-d3 are companyid’s of firms connected to for instance firm with lpermno 10001.

 

 CompanyID   lpermno           d1                 d2                         
10675            10001           8433               1723398              
620983           10002          576969           8433   
959                 10025           576969         1723398    
9137               10028           2070824       18195  

Thanks very much in advance for the assistance.

 

regards

ejaa.

 

 

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

What does the output look like for 10001?

EJAA
Obsidian | Level 7

Hello ChrisNZ

In the end, I want to obtain regression coefficients so for firm 10001 which is connected to 2 companies, the expected output must look like:

 

lpermno      CompanyID            Coefficient _estimates_volume        Coefficient_estimates_stk_retuns

10001                  8433                                a                                                         b

10001                 1723398                           c                                                         d

10001

.

.

.

 

In the original sample firm 10001 is connected to several other companies.

 

Many thanks in advance for the help. Hope the above explanation will help.

regards

ejaa

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 650 views
  • 0 likes
  • 2 in conversation