Proc psmatch

 

proc psmatch data=asdf1 region=cs;
class FLAG2 econ_status rural size ;
psmodel FLAG2(Treated="Y")=
n_10th_graders
prop_minority_10G;
match method=greedy(K=1) exact=(cate) stat=lps caliper=0.25;
output out(obs=match)=outgs2 lps=_Lps matchid=_matchID;
run;

R package matchit

Example using a R default data matcars.

library(MatchIt)
m.out0<-matchit(data=mtcars,am~hp+drat,exact=c("vs"),method="nearest", ratio=1, m.order="random", caliper=0.25)
m.out0

SAS PSMATCH

 

https://support.sas.com/documentation/onlinedoc/stat/142/psmatch.pdf

p. 7679 about three options.

The PSMATCH procedure optionally matches observations in the treated and control groups. The procedure
provides three strategies for propensity score matching.
 Greedy nearest neighbor matching selects the control unit nearest to each treated unit. Greedy nearest
neighbor matching is done sequentially for treated units and without replacement.
 Optimal matching selects all control units that match each treated unit by minimizing the total absolute
difference in propensity score across all matches. Optimal matching selects all matches simultaneously
and without replacement. Three methods for optimal matching are available: fixed ratio matching,
variable ratio matching, and full matching.
 Matching with replacement selects the control unit that best matches each treated unit. Each control
unit can be matched to more than one treated unit, but it can only be matched to the same treated unit
once.

Propensity score matching

Typing up an observation:

I had one old data and I updated two categorical variables (black and asian variables) in the new data.  The change was only in one group in the data (there were 10 groups all together).  Theoretically I would expect the matching results (in terms of means of the two variables) to change only in that group.  The changes also happened in two other groups.

proc psmatch data=psm region=cs;
where &outcome ne .;
class CP_FLAG districtname SCHOOLNAME ;
psmodel CP_FLAG(Treated="Y")= &exactvar &predictors;
match method=greedy(k=1)/*(order=random)*/ exact=districtname stat=lps caliper=&caliper;
output out(obs=match)=outgs lps=_Lps matchid=_matchID;
run;
proc sort data=outgs;by _matchID;run;

SAS propensity score matching procedure

proc psmatch data=psm region=cs;
where &outcome ne .;
class FLAG  districtname SCHOOLNAME ;
psmodel FLAG(Treated="Y")= &exactvar &predictors;
match method=greedy(k=1)/*(order=random)*/ exact=districtname stat=lps caliper=&caliper;
output out(obs=match)=outgs lps=_Lps matchid=_matchID;
run;
proc sort data=outgs;by _matchID;run;