<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Propensity score matching using psmatch - restricting matches in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817355#M40345</link>
    <description>&lt;P&gt;I am using psmatch to do a simple propensity score matching as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A snapshot of my data is the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
input year firm_id place_id treatment var1 var2;
DATALINES;
2000	47500	33019	0	0.026167367	0.118107848
2000	81175	31079	0	0.021634581	0.11606627
2000	174572	34003	0	0.008156653	0.108517274
2000	174572	34005	0	0.007877977	0.091809787
2000	174572	34007	0	0.010265773	0.085315727
2000	174572	34015	0	0.010941376	0.086731717
2000	223005	9009	0	0.009077159	0.088563122
2000	268006	33013	0	0.01309349	0.101272136
2000	268006	50027	0	0.009887925	0.098948561
2000	174572	9009	1	0.008821509	0.104278341
2000	174572	33013	1	0.009961594	0.120187096
2000	174572	45234	1	0.004693746	0.119641706
2000	223005	31079	1	0.005699048	0.144180074
2000	223005	33019	1	0.005843101	0.112463228
2000	223005	42311	1	0.005326652	0.138652623
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to do one-to-one nearest neighbor with replacement propensity score matching between treated observations (i.e., treatment=1) with control observations (i.e., treatment=0). Observations must be matched within the same year BUT each treated observation must be matched to a control observation with a DIFFERENT firm_id (that has the closest propensity score). I am using the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc psmatch data=have region=allobs;
	class treatment year;
	psmodel treatment(Treated='1') = var1 var2;
	match method=replace(k=1) stat=ps exact=year caliper=.;
	output out(obs=match)=have_match matchid=_MatchID;
run;

data have_match(keep=year firm_id place_id treatment _PS_ _MATCHWGT_ _matchid);set have_match;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, in the resultant "have_match" dataset:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result.png" style="width: 603px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72106iC3567825A781BA98/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.png" alt="result.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;we can clearly see that row 4 and row 5 are matched with row 1, which has the same firm_id of 174572. All other matches are fine because they are matched to a different firm_id. How can I fix the code using psmatch so that I can restrict the matches to a different firm_id? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2022 19:57:28 GMT</pubDate>
    <dc:creator>elbarto</dc:creator>
    <dc:date>2022-06-09T19:57:28Z</dc:date>
    <item>
      <title>Propensity score matching using psmatch - restricting matches</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817355#M40345</link>
      <description>&lt;P&gt;I am using psmatch to do a simple propensity score matching as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A snapshot of my data is the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
input year firm_id place_id treatment var1 var2;
DATALINES;
2000	47500	33019	0	0.026167367	0.118107848
2000	81175	31079	0	0.021634581	0.11606627
2000	174572	34003	0	0.008156653	0.108517274
2000	174572	34005	0	0.007877977	0.091809787
2000	174572	34007	0	0.010265773	0.085315727
2000	174572	34015	0	0.010941376	0.086731717
2000	223005	9009	0	0.009077159	0.088563122
2000	268006	33013	0	0.01309349	0.101272136
2000	268006	50027	0	0.009887925	0.098948561
2000	174572	9009	1	0.008821509	0.104278341
2000	174572	33013	1	0.009961594	0.120187096
2000	174572	45234	1	0.004693746	0.119641706
2000	223005	31079	1	0.005699048	0.144180074
2000	223005	33019	1	0.005843101	0.112463228
2000	223005	42311	1	0.005326652	0.138652623
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to do one-to-one nearest neighbor with replacement propensity score matching between treated observations (i.e., treatment=1) with control observations (i.e., treatment=0). Observations must be matched within the same year BUT each treated observation must be matched to a control observation with a DIFFERENT firm_id (that has the closest propensity score). I am using the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc psmatch data=have region=allobs;
	class treatment year;
	psmodel treatment(Treated='1') = var1 var2;
	match method=replace(k=1) stat=ps exact=year caliper=.;
	output out(obs=match)=have_match matchid=_MatchID;
run;

data have_match(keep=year firm_id place_id treatment _PS_ _MATCHWGT_ _matchid);set have_match;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, in the resultant "have_match" dataset:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result.png" style="width: 603px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72106iC3567825A781BA98/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.png" alt="result.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;we can clearly see that row 4 and row 5 are matched with row 1, which has the same firm_id of 174572. All other matches are fine because they are matched to a different firm_id. How can I fix the code using psmatch so that I can restrict the matches to a different firm_id? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 19:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817355#M40345</guid>
      <dc:creator>elbarto</dc:creator>
      <dc:date>2022-06-09T19:57:28Z</dc:date>
    </item>
    <item>
      <title>Propensity score matching using psmatch - restricting matches</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817219#M40347</link>
      <description>&lt;P&gt;I am using psmatch to do a simple propensity score matching as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A snapshot of my data is the following.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA have;
input year firm_id place_id treatment var1 var2;
DATALINES;
2000	47500	33019	0	0.026167367	0.118107848
2000	81175	31079	0	0.021634581	0.11606627
2000	174572	34003	0	0.008156653	0.108517274
2000	174572	34005	0	0.007877977	0.091809787
2000	174572	34007	0	0.010265773	0.085315727
2000	174572	34015	0	0.010941376	0.086731717
2000	223005	9009	0	0.009077159	0.088563122
2000	268006	33013	0	0.01309349	0.101272136
2000	268006	50027	0	0.009887925	0.098948561
2000	174572	9009	1	0.008821509	0.104278341
2000	174572	33013	1	0.009961594	0.120187096
2000	174572	45234	1	0.004693746	0.119641706
2000	223005	31079	1	0.005699048	0.144180074
2000	223005	33019	1	0.005843101	0.112463228
2000	223005	42311	1	0.005326652	0.138652623
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to do one-to-one nearest neighbor with replacement propensity score matching between treated observations (i.e., treatment=1) with control observations (i.e., treatment=0). Observations must be matched within the same year BUT each treated observation must be matched to a control observation with a DIFFERENT firm_id (that has the closest propensity score). I am using the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc psmatch data=have region=allobs;
	class treatment year;
	psmodel treatment(Treated='1') = var1 var2;
	match method=replace(k=1) stat=ps exact=year caliper=.;
	output out(obs=match)=have_match matchid=_MatchID;
run;&lt;BR /&gt;&lt;BR /&gt;data have_match(keep=year firm_id place_id treatment _PS_ _MATCHWGT_ _matchid);&lt;BR /&gt;set have_match;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, in the resultant "have_match" dataset:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elbarto_0-1654733524945.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72094i475EEEBF69CC0D77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="elbarto_0-1654733524945.png" alt="elbarto_0-1654733524945.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;we can clearly see that row 4 and row 5 are matched with row 1, which has the same firm_id of 174572. All other matches are fine because they are matched to a different firm_id. How can I fix the code using psmatch so that I can restrict the matches to a different firm_id? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 00:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817219#M40347</guid>
      <dc:creator>elbarto</dc:creator>
      <dc:date>2022-06-09T00:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Propensity score matching using psmatch - restricting matches</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817316#M40348</link>
      <description>Repost under Analytics -&amp;gt; Statistical Procedures</description>
      <pubDate>Thu, 09 Jun 2022 15:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Propensity-score-matching-using-psmatch-restricting-matches/m-p/817316#M40348</guid>
      <dc:creator>JOL</dc:creator>
      <dc:date>2022-06-09T15:25:58Z</dc:date>
    </item>
  </channel>
</rss>

