matching event sample to control sample but using any control

matching event sample to control sample but using any control

Post by nospa » Sat, 30 Sep 2006 10:03:56


This is not a simple problem.

Have a look at the Mayo Clinic macro library.

http://www.yqcomputer.com/
 
 
 

matching event sample to control sample but using any control

Post by J. Manuel » Sat, 30 Sep 2006 16:45:27

Hello Paul,

You need to provide more data.
I do not understand you when saying that match_id should be used once
every 5 years. Where you should not use it?

With the data you provide I just can suggest to add a date varible and
feed it with the date of the first use. Then use only the id with date
empty or less than 5 years from today. That is easy.

I whould like to help you more,
Manuel

 
 
 

matching event sample to control sample but using any control

Post by PBili » Tue, 03 Oct 2006 18:01:28

ello Manuel,

Thanks for replying! I probably did not express myself correctly.
I have two samples (sample of event firms and sample of non-event
firms) with different id's and two variables of importance i.e. size
(ME) and book-to-market (BEME). The sample firm and matches are taken
at different times over 30 years.

I would like to match each event firm with a non-event firm where the
ME of control lies within 30% of the event firm and BEME is the
closest. I need the control to be different than the event firm and
that is why I use eventfirm.id ^= match.id. In ideal circumstance, I
would use each control only once but the control sample is limited.

However, it happens that the closest control firm many times is similar
for many event firms. eg. for sample firm id=1, 4, 5 the programme
finds the same control i.e id=6. However, I want for sample firm id=1
to have a match id=8 and for id=4 to get match e.g.id=9, sample firm
id=5, match=10 etc. Only if the match id=6 has been used five years ago
I can use it again. For example for id=1 I find match=6 and for id=4
and I find closest match to be =6 (but the difference in times I use
the second match must be 5 years).

That is why I have the problem: how to use each match.id only once over
5 years....

will appreciate any help!

I do not understand what you mean by "feeding a date variable with the
date of first use". How do you do it in proc sql?

Paul

...............................................................................................................
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;
............................................................................................

J. Manuel Picaza wrote:

 
 
 

matching event sample to control sample but using any control

Post by PBili » Tue, 03 Oct 2006 18:03:25

Hi,

I know it is not easy and I already had a look at that webpage. The
problem is that they allow to use same match twice. Besides, I do not
follow most of the programmes.... I am too green with SAS yet...

Paul
 
 
 

matching event sample to control sample but using any control

Post by nospa » Thu, 05 Oct 2006 01:56:22


That's true of GMATCH. Look at VMATCH, which uses PROC ASSIGN to optimize
when controls are not to be re-used. You need a license for SAS/OR to be
able to use VMATCH.

But you have added a wrinkle by specifying that 5-year window. I'm just not
sure if there's a way to specify that to PROC ASSIGN.