Hi All,
I want to create a matched sample and while I was searching on the web, I came across a similar post by Paul
. So I copy Paul's post which exactly explains what I want to do, so please if you can help with that I will be so grateful for you.
“--------hello,
Since two weeks I am trying unsuccessfuly to solve the following
problem. I have a sample of event firms (small sample) and non-event
firms (big sample). I need to match each event firm with non-event firm
that is similar on -/+30% size and closest another ratio (BEME).
However, I want each control firm to be used only once (unless it is
used another time five years after its first use).
I found the following code, which I tried to implement in iterative way
but it is not working.
proc sql;
create table SEO_matches as
select eventfirm.*,
match.id as match_id,
match.ME as match_ME,
match.beme as match_beme,
abs(eventfirm.bemv - match.beme) as bmabsdiff
from eventfirm
join noneventfirms as match
on (eventfirm.OfferYear1 - 1 ) = match.year
where 0.7 * eventfirm.me < match.me < 1.3 * eventfirm.me
and eventfirm.id^= match.idand not missing(match.beme) and not
missing(match.me) group by eventfirm.id
having bmabsdiff = min(bmabsdiff) ;
data SEO_matches; set SEO_matches;
by id;
if first.id;
run;
-------The end of Paul post”
To see Paul post open this link
http://www.rhinocerus.net/forum/soft-sys-sas/502636-re-matching-event-sample-control-sample-but-usin...
Many thanks