<?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: Herfindahl Index calculation command in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113880#M31529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm...two thoughts.&amp;nbsp; First, SIC is stored as a numeric variable, correct?&amp;nbsp; Sometimes variables like that look numeric but are actually stored as characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, maybe change each line to include a second SIC before the le, for example: if SIC ge 0100 AND SIC le 1799 then herfSIC =1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if that fixes it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2012 11:44:00 GMT</pubDate>
    <dc:creator>yeaforme</dc:creator>
    <dc:date>2012-05-18T11:44:00Z</dc:date>
    <item>
      <title>Error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113875#M31524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tech savvy friends.&lt;/P&gt;&lt;P&gt;I am looking to write a command on SAS but keep receiving an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have managed to sum the total revenues for a particular industry, in a given year. The individual companies proportion of the industries yearly total revenue is then determined. This weight is then squared to create a concentration score for each company.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 15:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113875#M31524</guid>
      <dc:creator>ncross</dc:creator>
      <dc:date>2012-05-14T15:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113876#M31525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shouldn't be too hard - though my solution may not be the most efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* First, create new SIC codes for herfindahl */&lt;/P&gt;&lt;P&gt;data whateveryourdatasetnameis; set whateveryourdatasetnameis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 0100 AND le 1799 then herfSIC = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 2000 AND le 3999 then herfSIC = 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 4000 AND le 4999 then herfSIC = 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 5000 AND le 5199 then herfSIC = 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 5200 AND le 5999 then herfSIC = 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 6000 AND le 6799 then herfSIC = 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SIC ge 7000 AND le 9999 then herfSIC = 7;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Then create sums of revenue by newly-created industry variable herfSIC */&lt;/P&gt;&lt;P&gt;proc summary data = whateveryourdatasetnameis;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by herfSIC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var whatevertherevenuevariableiscalled; output out = test sum = herfRev;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Assuming the resulting output dataset has the original data as well, now just figure out the portion and square - if not, then first merge which I won't do here */&lt;/P&gt;&lt;P&gt;data test; set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; herfInd = (whatevertherevenuevariableiscalled / herfRev) ** 2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2012 19:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113876#M31525</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2012-05-14T19:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113877#M31526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite impressive. Our methods share similarities&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I believe you are calculating the total revenues on the industry only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 00:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113877#M31526</guid>
      <dc:creator>ncross</dc:creator>
      <dc:date>2012-05-15T00:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113878#M31527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify the proc summary to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by herfSIC whateveryouryearvariableiscalled;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of just:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by herfSIC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and that should solve it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 00:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113878#M31527</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2012-05-15T00:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113879#M31528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm seems to be an error with the step 1 PROC.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 03:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113879#M31528</guid>
      <dc:creator>ncross</dc:creator>
      <dc:date>2012-05-18T03:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113880#M31529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm...two thoughts.&amp;nbsp; First, SIC is stored as a numeric variable, correct?&amp;nbsp; Sometimes variables like that look numeric but are actually stored as characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, maybe change each line to include a second SIC before the le, for example: if SIC ge 0100 AND SIC le 1799 then herfSIC =1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if that fixes it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 11:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113880#M31529</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2012-05-18T11:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113881#M31530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ooh let me see...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 01:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113881#M31530</guid>
      <dc:creator>ncross</dc:creator>
      <dc:date>2012-05-24T01:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Herfindahl Index calculation command</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113882#M31531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked brilliantly! Hooray for us&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 01:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error/m-p/113882#M31531</guid>
      <dc:creator>ncross</dc:creator>
      <dc:date>2012-05-24T01:49:17Z</dc:date>
    </item>
  </channel>
</rss>

