DATA Step, Macro, Functions and more

How to find the observations that satisfy a matching criteria?

Reply
Occasional Contributor
Posts: 8

How to find the observations that satisfy a matching criteria?

Hello, guys. I'm trying to replicate a empirical paper and I stick in a data step. Basically, I have a list of ID, dates, industry and firm ratios. What I wan to do is to locate another company with different id but the same date in another larger data set, Also, this matching company should be in the same industry and have similar ratios (within the range of plus and minus 10% of the companies in the original list). I'm wondering anyone can help?

Thank you so much

XB

Super User
Posts: 5,431

Re: How to find the observations that satisfy a matching criteria?

To perform conditional matching, use SQL join.

Data never sleeps
Trusted Advisor
Posts: 2,116

Re: How to find the observations that satisfy a matching criteria?

This is a common problem in epidemiology.  Sufficiently so, that some macros have been developed.  Check out

http://support.sas.com/resources/papers/proceedings10/061-2010.pdf

(I just googled

matching macro site:sas.com

).

As LinusH suggests, you could do it as a one-off with SQL.  If your large data set is really big, the computer time might be huge.

Ask a Question
Discussion stats
  • 2 replies
  • 214 views
  • 0 likes
  • 3 in conversation