BookmarkSubscribeRSS Feed
johanna3
Calcite | Level 5

Hi,

 

I would like to do a greedy matching - but with replacement and all of the possible control matches pr. case - does anyone know how to code this in the PSMATCH procedure?

 

I need to have all possible matches shown pr. case within the specified caliper of course as I need to take another variable into account after the matching procedure.

 

Present code is this which works, but 1) Doesnt provide all possible matches 2) doesnt have replacement:

 

ods graphics on;

proc psmatch data=stat5 region=cs;

class eventbarn;

psdata treatvar=eventbarn (Treated='1') ps=ssps;

match method=greedy (k=3) caliper=0.2;

assess ps var=(baseline_edss disease_duration age_diagnosis) / plots=all;

output out(obs=match) =outstat1 matchid=_matchid;

run;

 

4 REPLIES 4
MichaelL_SAS
SAS Employee

To request a matching with replacement you would specify METHOD=REPLACE instead of METHOD=GREEDY in the MATCH statement. 

johanna3
Calcite | Level 5

Hi Michaell,

 

I have tried this, but for some reason I dont know this results in a dataset where two or more cases come out with the same _matchID. I dont know why this happens, but I need individual matchid's pr. case.

Do you have any ideas on how/why this happens, and how I can avoid it?

MichaelL_SAS
SAS Employee

For a matching with replacement the match id values account for both direct and indirect connections. This is discussed the ATT Weighting after Matching with Replacement section of the PROC PSMATCH documentation. Two or more treated units (cases) will be in the same match group when they are both matched to a common control unit and therefore share an indirect connection. I don't believe there is a way to change this behavior. 

johanna3
Calcite | Level 5
Thank you - that makes sense.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 4 replies
  • 1074 views
  • 0 likes
  • 2 in conversation