<?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 Re: Matching firms using firm size and industry in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140224#M37483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried using this - for the same financial year. What is your view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=huang_599;&lt;/P&gt;&lt;P&gt;by gvkey fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=huang_bal;&lt;/P&gt;&lt;P&gt;by gvkey fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table control as&lt;/P&gt;&lt;P&gt;select O.*, A.gvkey as Anum, A.fyear as Afy, abs(O.size-A.size) as sizeDiff&lt;/P&gt;&lt;P&gt;from huang_bal as O inner join huang_599 as A &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on O.fYear=A.fyear and O.ffind=A.ffind&lt;/P&gt;&lt;P&gt;where O.gvkey not in (select gvkey from huang_599) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by gvkey;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=control;&lt;/P&gt;&lt;P&gt;by anum afy;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Find the 1 set of 599 closest firms&amp;nbsp; */&lt;/P&gt;&lt;P&gt;proc means data=control noprint;&lt;/P&gt;&lt;P&gt;by Anum afy;&lt;/P&gt;&lt;P&gt;output out=selected idgroup(min(sizeDiff) out[1] (fyear gvkey)=);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table selected1 as&lt;/P&gt;&lt;P&gt;select a.*, b.*&lt;/P&gt;&lt;P&gt;from selected a left join&amp;nbsp; huang_bal b&lt;/P&gt;&lt;P&gt;on a.gvkey=b.gvkey and a.fyear=b.fYear&lt;/P&gt;&lt;P&gt;order by a.gvkey, a.fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data selected1;&lt;/P&gt;&lt;P&gt;set selected1;&lt;/P&gt;&lt;P&gt;drop _freq_ _type_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;**599**;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data combined;&lt;/P&gt;&lt;P&gt;set huang_599 selected1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt; **1198**;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2014 11:38:30 GMT</pubDate>
    <dc:creator>mei</dc:creator>
    <dc:date>2014-09-11T11:38:30Z</dc:date>
    <item>
      <title>Matching firms using firm size and industry</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140222#M37481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 datasets, original_599 and balance_9981.(original_599 dataset has n=599 firms/ years and balance_9981 dataset has n=9981 firms/.years).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find 599 firms from the 9981 firms to match with the original_599 dataset based on their industry (ffind) and size (size).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The different characteristics of original_599 is CEOturn=1 while balance_9981 CEOturn=0.&amp;nbsp; (Ceoturn=Ceo turnover)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to have 2 options:&lt;/P&gt;&lt;P&gt;a) those firms matched are from the same financial year (fyear) &lt;/P&gt;&lt;P&gt;b) no need to match same financial year (as they may not be able to find the suitable one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 07:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140222#M37481</guid>
      <dc:creator>mei</dc:creator>
      <dc:date>2014-09-11T07:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Matching firms using firm size and industry</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140223#M37482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First match on Fiscal Year.&lt;/P&gt;&lt;P&gt;The in the next loop match without Fiscal Year, but exclude the ones that already have a match...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 10:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140223#M37482</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-09-11T10:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Matching firms using firm size and industry</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140224#M37483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried using this - for the same financial year. What is your view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=huang_599;&lt;/P&gt;&lt;P&gt;by gvkey fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=huang_bal;&lt;/P&gt;&lt;P&gt;by gvkey fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table control as&lt;/P&gt;&lt;P&gt;select O.*, A.gvkey as Anum, A.fyear as Afy, abs(O.size-A.size) as sizeDiff&lt;/P&gt;&lt;P&gt;from huang_bal as O inner join huang_599 as A &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on O.fYear=A.fyear and O.ffind=A.ffind&lt;/P&gt;&lt;P&gt;where O.gvkey not in (select gvkey from huang_599) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by gvkey;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=control;&lt;/P&gt;&lt;P&gt;by anum afy;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Find the 1 set of 599 closest firms&amp;nbsp; */&lt;/P&gt;&lt;P&gt;proc means data=control noprint;&lt;/P&gt;&lt;P&gt;by Anum afy;&lt;/P&gt;&lt;P&gt;output out=selected idgroup(min(sizeDiff) out[1] (fyear gvkey)=);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table selected1 as&lt;/P&gt;&lt;P&gt;select a.*, b.*&lt;/P&gt;&lt;P&gt;from selected a left join&amp;nbsp; huang_bal b&lt;/P&gt;&lt;P&gt;on a.gvkey=b.gvkey and a.fyear=b.fYear&lt;/P&gt;&lt;P&gt;order by a.gvkey, a.fyear;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data selected1;&lt;/P&gt;&lt;P&gt;set selected1;&lt;/P&gt;&lt;P&gt;drop _freq_ _type_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;**599**;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data combined;&lt;/P&gt;&lt;P&gt;set huang_599 selected1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt; **1198**;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 11:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Matching-firms-using-firm-size-and-industry/m-p/140224#M37483</guid>
      <dc:creator>mei</dc:creator>
      <dc:date>2014-09-11T11:38:30Z</dc:date>
    </item>
  </channel>
</rss>

