<?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: Median with panel data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Median-with-panel-data/m-p/86924#M24823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I have not used PROC PANEL, I do not believe that that it supports programming statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can calculate the median of a variable using other procedures.&amp;nbsp; Most likely for your needs will be either MEANS or SUMMARY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;proc summary data=have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;class country;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;var size;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;output out=want median= /autoname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2013 02:13:54 GMT</pubDate>
    <dc:creator>ArtC</dc:creator>
    <dc:date>2013-03-25T02:13:54Z</dc:date>
    <item>
      <title>Median with panel data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Median-with-panel-data/m-p/86923#M24822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to find the median of the size variable for each country in my panel dataset and create a dummy variable:1 for values &amp;gt;median and 0 otherwise.&lt;/P&gt;&lt;P&gt;I read and also realised while doing,that the median function does not work using Proc SQL.So,I tried the simple Proc Panel command:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Having sorted the data by country,firm and year,I used the following steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt;"&gt;proc panel&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; data=have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;by country;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;new=median(size);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The error that comes up is: &lt;/SPAN&gt;Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;Can anybody advise about the median?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 01:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Median-with-panel-data/m-p/86923#M24822</guid>
      <dc:creator>namrata</dc:creator>
      <dc:date>2013-03-25T01:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Median with panel data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Median-with-panel-data/m-p/86924#M24823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I have not used PROC PANEL, I do not believe that that it supports programming statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can calculate the median of a variable using other procedures.&amp;nbsp; Most likely for your needs will be either MEANS or SUMMARY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;proc summary data=have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;class country;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;var size;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;output out=want median= /autoname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 02:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Median-with-panel-data/m-p/86924#M24823</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2013-03-25T02:13:54Z</dc:date>
    </item>
  </channel>
</rss>

