BookmarkSubscribeRSS Feed
GokulK
Calcite | Level 5

I need your help with a code. I have three samples (Sample A, B, and C). All three samples have information on SIZE, CAPEX, LEVERAGE, INDUSTRY, and YEAR. I want to create two new samples D and E.  

 

In sample D, I want to match sample A with sample C based on INDUSTRY, YEAR, SIZE, and LEVERAGE. That is, the matched firm from sample C should belong to the same industry and year as the firm in sample A. Also, the difference in SIZE + difference in LEVERAGE in the matched firms should be minimum.

 

In sample E, I want to match sample B with sample C based on INDUSTRY, YEAR, CAPEX, and LEVERAGE. That is, the matched firm from sample C should belong to the same industry and year as the firm in sample B. Also, the difference in CAPEX + difference in LEVERAGE between the firm in samples B and C should be minimum.

 

Another condition is that the firms from sample C that are matched with sample A should not be used in the matching procedure of sample B.

 

In the attached file I have used an example to show the sample that I have and the sample that I want.

 

I would greatly appreciate it if someone provided me with the code so that I could get the desired output.

 

Best regards,

Gokul

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 0 replies
  • 573 views
  • 0 likes
  • 1 in conversation