Hello,
I want to condunct PSMATCH to have the matched sets of id which correspond to the treatment group.
I want your help to understand Example 96.4 Greedy Nearest Neighbor Matching https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_psmatch_examples04.htm
column match_id is supposed to give the id of matched group so why I did not see sudentID in this column???
Doesn't that report mean that StudentIDs 156 and 173 form the first match?
so why I did not find the same thing using my data and program ?
proc psmatch data=man.pms_data region=treated;
class IPO ;
psmodel IPO(Treated='yes')= age Net_asset_share_class Expenses Turnover manger_tenure_average count_name flux;
match distance=lps method=greedy(k=1) caliper=0.5;
assess lps var=( age Net_asset_share_class Expenses Turnover manger_tenure_average count_name flux)
/ stddev=pooled(allobs=no) stdbinvar=no
weight=none;
output out(obs=match)=OutEx4 matchid=_MatchID;
run;
this is my OUTEX4
yes this is all my variable by not all the data. this is a screenshot of proc contents
Thanks, but this appears to be your original data set. What about `OutEx4`? Can you show me that one?
With this statement:
output out(obs=match)=OutEx4 matchid=_MatchID;
you are creating a new data set, `OutEx4`. That should have _matchID.
thanks for your help
the outExt give the matched Id. when I make a proc sort by _MatchID I find the same table as Output 96.4.14: Output Data Set with Matching Numbers
however I find that the program match each observation for the treatment group with only one observation in the control group
but I want to match each observation for the treatment group with multiple observations in the control group if the PMS score allow.
can you help me to have the good procedure for that ?
@sasphd wrote:
thanks for your help
the outExt give the matched Id. when I make a proc sort by _MatchID I find the same table as Output 96.4.14: Output Data Set with Matching Numbers
however I find that the program match each observation for the treatment group with only one observation in the control group
but I want to match each observation for the treatment group with multiple observations in the control group if the PMS score allow.
can you help me to have the good procedure for that ?
You specified K=1 in your code, which means it matches 1:1.
To match at a different ratio you would specify a different k.
proc psmatch data=man.pms_data region=treated; class IPO ; psmodel IPO(Treated='yes')= age Net_asset_share_class Expenses Turnover manger_tenure_average count_name flux; match distance=lps method=greedy(k=1) caliper=0.5; assess lps var=( age Net_asset_share_class Expenses Turnover manger_tenure_average count_name flux) / stddev=pooled(allobs=no) stdbinvar=no weight=none; output out(obs=match)=OutEx4 matchid=_MatchID; run;
METHOD=GREEDY <(K=k ORDER=order-option)>
requests greedy nearest neighbor matching, in which each treated unit is sequentially matched with the k nearest control units. Matching depends on the ordering of the treated units, which you can specify in the ORDER= suboption.
You can specify the following suboptions:
specifies the number of matching control units, where k > 0, for each treated unit. PROC PSMATCH performs k separate loops of matching for treated units. In each loop, the nearest control unit is sequentially matched to each treated unit. By default, K=1 (one control unit for each treated unit).
thanks for the response.
I wonder if there is a method in proc psmatch that give the optimal matching of control group?
I've never used the PSMATCH procedure, but @Tom seems to be right. I looked up the user guide and it seemed to go along with that idea.
https://support.sas.com/documentation/onlinedoc/stat/142/psmatch.pdf
Page 7687
and the MATCHID=_MatchID
option creates a variable named _MatchID that identifies the matched sets of observations.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.