Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
alex_r-o-x
Calcite | Level 5

Hey everyone,

 

I'm quite new to SAS programming and I'm trying to work with the psmatch procedure. I'm trying to achieve a 1:2 fixed matching with caliper.

 

This is my code:

 

proc psmatch data = test1 region = Cs; class Locus_Stumpf R Kompli_chir;
psmodel Locus_Stumpf(Treated='1') = Alter OP_Jahr OP_Erweiterung
HIPEC Kompli_alle Kompli_chir OP_Typ Histo_Siegel R T N M UICC_einfach;
match method = greedy (k=2 order=descending) stat = PS exact = R exact = Kompli_chir caliper = 0.05;
output out (obs=match) = Outgs matchid = MatchID;
run;

 

in the log, it shows following warning, when I run this code:

Some treated units have less than the specified K=2 matched controls because there are not
enough available controls for these treated units.

 

I have 83 treated subjects in my data and my goal is it to match exactly 2 untreated subjects per treated subject (k=2). I thought that if I used method = greedy with a caliper, SAS would pair exactly one to two, automatically excluding all treated subjects, for which there aren't enough untreated subjects in the caliper width.

Instead, the program pairs some treated subjects with only ONE untreated subject instead of two.

 

Why is it mantaining the treated subjects when the program should actually exclude them? or did I understand the method = greedy option wrongly?

 

How can I achieve that the program excludes all treated subjects, for which there don't exist 2 adequate untreated partners (within the caliper width)?

 

Thanks in advance!

1 REPLY 1
Reeza
Super User
I think you're misunderstanding greedy, it just means it goes through in the specified order and takes the first best match for each, ignoring what comes next. A later record may have a closer match to the record in question but since you're using a 'greedy' method, that is already selected and would not be selected again.

I would have expected the OBS=MATCH to have restricted the dataset to just matched values but you already have that in your code. I do not see an option to do what you request by default but you can filter it out fairly easily after the fact by isolating any records that only have one 1 match.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1229 views
  • 0 likes
  • 2 in conversation