<?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 Without Replacement Treatment and Control Firms in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Without-Replacement-Treatment-and-Control-Firms/m-p/684062#M207256</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am trying to come up with control firms for treatment firms in the sample. It is a cross-sectional data, and I want one control firm (matched within the same industry code and closest propensity score) for each treatment firm. So, one-on-one matching for a treatment-control pair.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If firm B can act as a control firm for firm A (based on the criteria, i.e. same industry code and closest propensity), then it should not act as a control for any other firm. However, the next best alternative should be used as a control firm, i.e. within the same industry code, but the next best closest propensity score.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;firm_id&amp;nbsp; Treatment_indicator Industry_code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pscore&lt;/P&gt;&lt;P&gt;1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.35&lt;/P&gt;&lt;P&gt;1112&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.44&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1113&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.60&lt;/P&gt;&lt;P&gt;1114&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.80&lt;/P&gt;&lt;P&gt;1115&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.56&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After creating two separate files for treatment and control firms, I am using this code (I got it from previous posts):&lt;BR /&gt;&lt;BR /&gt;data treatment_firms conrol_firms;&lt;BR /&gt;set have;&lt;BR /&gt;if treatment_indicator = 0 then output control_firms;&lt;BR /&gt;if treatment_indicator = 1 then output treatment_firms;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table like_each_other as&lt;BR /&gt;select O.*, T.firm_id as Tfirm_id, abs(O.pscore-T.pscore) as P_Diff&lt;BR /&gt;from control_firms as O inner join treatment_firms as T&lt;BR /&gt;on o.industry_code=t.industry_code&lt;BR /&gt;order by tfirm_id;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;proc means data=like_each_other noprint;&lt;BR /&gt;by Tfirm_id;&lt;BR /&gt;output out=close_match idgroup(min(P_diff) out[1] (firm_id)=);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Can you please help in coming up with the correct codes? These codes are working on 'with replacement' basis, so, one control firm is chosen as a 'control firm' for another treatment firm as well. I want one firm to act as a control for only one treatment firm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Aman&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2020 01:05:57 GMT</pubDate>
    <dc:creator>amanjot_42</dc:creator>
    <dc:date>2020-09-16T01:05:57Z</dc:date>
    <item>
      <title>Without Replacement Treatment and Control Firms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-Replacement-Treatment-and-Control-Firms/m-p/684062#M207256</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am trying to come up with control firms for treatment firms in the sample. It is a cross-sectional data, and I want one control firm (matched within the same industry code and closest propensity score) for each treatment firm. So, one-on-one matching for a treatment-control pair.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If firm B can act as a control firm for firm A (based on the criteria, i.e. same industry code and closest propensity), then it should not act as a control for any other firm. However, the next best alternative should be used as a control firm, i.e. within the same industry code, but the next best closest propensity score.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;firm_id&amp;nbsp; Treatment_indicator Industry_code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pscore&lt;/P&gt;&lt;P&gt;1111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.35&lt;/P&gt;&lt;P&gt;1112&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.44&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1113&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.60&lt;/P&gt;&lt;P&gt;1114&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.80&lt;/P&gt;&lt;P&gt;1115&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.56&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After creating two separate files for treatment and control firms, I am using this code (I got it from previous posts):&lt;BR /&gt;&lt;BR /&gt;data treatment_firms conrol_firms;&lt;BR /&gt;set have;&lt;BR /&gt;if treatment_indicator = 0 then output control_firms;&lt;BR /&gt;if treatment_indicator = 1 then output treatment_firms;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table like_each_other as&lt;BR /&gt;select O.*, T.firm_id as Tfirm_id, abs(O.pscore-T.pscore) as P_Diff&lt;BR /&gt;from control_firms as O inner join treatment_firms as T&lt;BR /&gt;on o.industry_code=t.industry_code&lt;BR /&gt;order by tfirm_id;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;proc means data=like_each_other noprint;&lt;BR /&gt;by Tfirm_id;&lt;BR /&gt;output out=close_match idgroup(min(P_diff) out[1] (firm_id)=);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Can you please help in coming up with the correct codes? These codes are working on 'with replacement' basis, so, one control firm is chosen as a 'control firm' for another treatment firm as well. I want one firm to act as a control for only one treatment firm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Aman&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 01:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-Replacement-Treatment-and-Control-Firms/m-p/684062#M207256</guid>
      <dc:creator>amanjot_42</dc:creator>
      <dc:date>2020-09-16T01:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Without Replacement Treatment and Control Firms</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-Replacement-Treatment-and-Control-Firms/m-p/684294#M207347</link>
      <description>We  do not want to re-invent the PSMATCH procedure here. The default for this procedure is without replacement, so it will suit just fine:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=statug_psmatch_syntax06.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=statug_psmatch_syntax06.htm&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;Here is a nice example to work from (omit "method=replace" for without replacement):&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_psmatch_examples05.htm%3Flocale&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_psmatch_examples05.htm%3Flocale&amp;amp;docsetVersion=14.2&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Wed, 16 Sep 2020 15:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-Replacement-Treatment-and-Control-Firms/m-p/684294#M207347</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T15:46:52Z</dc:date>
    </item>
  </channel>
</rss>

