<?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 how to get industry median excluding focal firm in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516501#M16032</link>
    <description>&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am a beginner in SAS, I hope I can get some help from the community.&lt;/P&gt;&lt;P&gt;I am trying to calculate the industry median R&amp;amp;D expense for each year excluding the focal firm, the industry is indicated by the 4-digit SIC code.&lt;/P&gt;&lt;P&gt;For example, assume the data is from 2000-2005 for 10 firms: A, B, C, D, E have same SIC code, and F, G, H, I, J have the same SIC code,&amp;nbsp; each firm has data covering those 6 years, how do I get the industry median RD expenses excluding each focal firm for each industry and year?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;yzs0056&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 27 Nov 2018 22:02:00 GMT</pubDate>
    <dc:creator>yzs0056</dc:creator>
    <dc:date>2018-11-27T22:02:00Z</dc:date>
    <item>
      <title>how to get industry median excluding focal firm</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516501#M16032</link>
      <description>&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am a beginner in SAS, I hope I can get some help from the community.&lt;/P&gt;&lt;P&gt;I am trying to calculate the industry median R&amp;amp;D expense for each year excluding the focal firm, the industry is indicated by the 4-digit SIC code.&lt;/P&gt;&lt;P&gt;For example, assume the data is from 2000-2005 for 10 firms: A, B, C, D, E have same SIC code, and F, G, H, I, J have the same SIC code,&amp;nbsp; each firm has data covering those 6 years, how do I get the industry median RD expenses excluding each focal firm for each industry and year?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;yzs0056&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Nov 2018 22:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516501#M16032</guid>
      <dc:creator>yzs0056</dc:creator>
      <dc:date>2018-11-27T22:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get industry median excluding focal firm</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516521#M16033</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/248665"&gt;@yzs0056&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;
&lt;DIV class="lia-message-body"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am a beginner in SAS, I hope I can get some help from the community.&lt;/P&gt;
&lt;P&gt;I am trying to calculate the industry median R&amp;amp;D expense for each year excluding the focal firm, the industry is indicated by the 4-digit SIC code.&lt;/P&gt;
&lt;P&gt;For example, assume the data is from 2000-2005 for 10 firms: A, B, C, D, E have same SIC code, and F, G, H, I, J have the same SIC code,&amp;nbsp; each firm has data covering those 6 years, how do I get the industry median RD expenses excluding each focal firm for each industry and year?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;yzs0056&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do we know which is the "focal firm"? For each year? I have to assume that you have a variable that represents year.&lt;/P&gt;
&lt;P&gt;Some example data that you can mention specific values/variable names is helpful. Also, do you need a data set (further computer use) or a report (people read the result) or possibly both?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely easiest would be to add a variable that indicates whether the specific record is from a "focal firm". The use a where clause in a procedure to exclude them. Supposing you have a variable named FocalFirm that has a value of 1 when the record is from a focal firm and 0 otherwise you might have something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=have median;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where focalfirm=0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; class SIC;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; var RandDExpense;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;Procs Means, Summary, Tabulate, Univariate and Report will generate medians.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 23:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516521#M16033</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-27T23:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to get industry median excluding focal firm</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516526#M16034</link>
      <description>Can you do this for the base case, ie one firm? If so, you can then create a macro and use that. The usual methods won't work for a median type calculations so you do need to do it repetitively&lt;BR /&gt;&lt;BR /&gt;Once you've got the base case working, you can turn it into a macro and call it once for each 'focal firm'. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Nov 2018 23:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/how-to-get-industry-median-excluding-focal-firm/m-p/516526#M16034</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-27T23:39:09Z</dc:date>
    </item>
  </channel>
</rss>

