BookmarkSubscribeRSS Feed
saf_sas
Calcite | Level 5

Hello,

 

I’m trying to match my ‘treatment’ dataset with two control datasets – control1 and control2. Here are the rules:

  1. I match treatment firms against control firms based on SIC2, fyear and the closest asset.
  2. Each treatment firm must have one match in 'control1' AND one match in 'control2'. In other words, matched treatment firms must have 2 control firms, selected from two groups. Any unmatched firm (even if it has one control from either group) should be deleted.
  3. My final result should append matched observations from all three groups (treatment, control1, and control2).
  4. In addition, there should be three columns indicating whether the observation is from treatment, control1 or control2.

In the attachment, I’ve some sample data along with my expected result. I highly appreciate your cooperation.

2 REPLIES 2
LinusH
Tourmaline | Level 20
Well this is whole application. And I don't think the communities are intended for business related application design and development.
Please try to outline the steps necessary and boil down any problems you might encounter to more specific questions.
Data never sleeps
saf_sas
Calcite | Level 5

Hi LinusH,

 

This is the part I've been struggling with. I do know how to match one treatment with one control but couldn't help myself with this problem - one treatment with two controls, where controls come from two different datasets. I hope someone here could help me out. SIC's and fyears are not necessarily required for the solution, which I think mitigates your concern about business related application. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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