<?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: Finding closest matches in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56995#M12226</link>
    <description>I suggest you consider flagging each of your targets for size and ROA separately. I find using boolean (0 or 1) flags are very useful:&lt;BR /&gt;
&lt;BR /&gt;
target_size = 123;&lt;BR /&gt;
target_ROA = 456;&lt;BR /&gt;
flag_size = (abs(size - target_size)/target_size LE 0.3); &lt;BR /&gt;
flag_ROA = (abs(ROA - target_ROA)/target_ROA LE 0.3); &lt;BR /&gt;
&lt;BR /&gt;
This logic creates flags that will contain 1 if they are within 30%, 0 if they are not.</description>
    <pubDate>Wed, 28 Jul 2010 22:41:24 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2010-07-28T22:41:24Z</dc:date>
    <item>
      <title>Finding closest matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56994#M12225</link>
      <description>I have a dataset with some firms identified as "targets." I would like to select firms that are within +/- 30% of two parameters (size and ROA) of the targets and somehow flag these firms (other targets can be included in the flagged firms). Ultimately I would like to take the average size of these flagged firms relative to the respective target. Does this make sense? I do not know where to start!&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any direction you can provide.</description>
      <pubDate>Wed, 28 Jul 2010 19:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56994#M12225</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-28T19:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding closest matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56995#M12226</link>
      <description>I suggest you consider flagging each of your targets for size and ROA separately. I find using boolean (0 or 1) flags are very useful:&lt;BR /&gt;
&lt;BR /&gt;
target_size = 123;&lt;BR /&gt;
target_ROA = 456;&lt;BR /&gt;
flag_size = (abs(size - target_size)/target_size LE 0.3); &lt;BR /&gt;
flag_ROA = (abs(ROA - target_ROA)/target_ROA LE 0.3); &lt;BR /&gt;
&lt;BR /&gt;
This logic creates flags that will contain 1 if they are within 30%, 0 if they are not.</description>
      <pubDate>Wed, 28 Jul 2010 22:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56995#M12226</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-07-28T22:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Finding closest matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56996#M12227</link>
      <description>Thank you for your response! The only issue I see with that solution is that it is only good for one target at a time - I have about 100 targets within the dataset (and targets can be in the list of matches for other targets). Is there a way to loop that logic so that I do not have to separately identify the matches? Thanks!!</description>
      <pubDate>Thu, 29 Jul 2010 12:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56996#M12227</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-29T12:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding closest matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56997#M12228</link>
      <description>EC,&lt;BR /&gt;
&lt;BR /&gt;
There is a broad literature on this.  Search, for example, for "nearest match" in the forums and you will find&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=39419駻" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=39419駻&lt;/A&gt;&lt;BR /&gt;
It has links to lots of techniques to use.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Thu, 29 Jul 2010 13:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56997#M12228</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-07-29T13:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding closest matches</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56998#M12229</link>
      <description>Perhaps I should have been more explicit:&lt;BR /&gt;
&lt;BR /&gt;
data targets;&lt;BR /&gt;
set xxx;&lt;BR /&gt;
target_size = 123;&lt;BR /&gt;
target_ROA = 456;&lt;BR /&gt;
flag_size = (abs(size - target_size)/target_size LE 0.3); &lt;BR /&gt;
flag_ROA = (abs(ROA - target_ROA)/target_ROA LE 0.3); &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This program will flag as many "targets" as there are rows in your input data - hundreds or more. Each of your rows will have two flags, one for size and one for ROA. To select rows meeting your size target:&lt;BR /&gt;
&lt;BR /&gt;
Add: where flag_size = 1;</description>
      <pubDate>Thu, 29 Jul 2010 21:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-closest-matches/m-p/56998#M12229</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-07-29T21:18:31Z</dc:date>
    </item>
  </channel>
</rss>

