<?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: How to create groups by deciles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300621#M63511</link>
    <description>&lt;P&gt;1. Use Proc Rank with group=10 if you want deciles.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Look at Proc means to generate summary statistics. If you need summary statistic by group look at the CLASS or BY statement in Proc means.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Sep 2016 16:05:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-25T16:05:03Z</dc:date>
    <item>
      <title>How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300615#M63510</link>
      <description>&lt;P&gt;Hello Everyone i am new to sas&amp;nbsp;so fighting&amp;nbsp;long to do a thing which may be simple to you. Kindly help me in this regards&lt;/P&gt;
&lt;P&gt;i have just four variables,&lt;/P&gt;
&lt;P&gt;PerMNO is firm identifier&lt;/P&gt;
&lt;P&gt;Names Date = date (there are 10 years from 2004 to 2014 which i am interested.)&lt;/P&gt;
&lt;P&gt;Returns = monthly returns&lt;/P&gt;
&lt;P&gt;Mrktcapt = market capitalization&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i have am trying to do :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) organize this data in decile on the basis of Marktcapt&lt;/P&gt;
&lt;P&gt;2) find the mean return and standard deviation of return in each year.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have attached a data file and the&amp;nbsp;second sheet in this excel file show a sample for what i am trying to do.&lt;/P&gt;
&lt;P&gt;Please give help me with some codes which can do this thing.&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 14:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300615#M63510</guid>
      <dc:creator>raqthesolid</dc:creator>
      <dc:date>2016-09-25T14:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300621#M63511</link>
      <description>&lt;P&gt;1. Use Proc Rank with group=10 if you want deciles.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Look at Proc means to generate summary statistics. If you need summary statistic by group look at the CLASS or BY statement in Proc means.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 16:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300621#M63511</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-25T16:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300628#M63513</link>
      <description>&lt;P&gt;i tried Proc Rank codes&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=apt.nyse out=rnyse groups=10;
	by mrktcapt;
	var returns;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but i don't think it is right. it converted my returns into groups (1-10) but i want them to be as they are and groups of "Mrktcapt" and plus i want their ranking in each year but i am not able to do it .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;kindly write some line of codes. thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 17:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300628#M63513</guid>
      <dc:creator>raqthesolid</dc:creator>
      <dc:date>2016-09-25T17:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300632#M63515</link>
      <description>&lt;P&gt;Your grouping variable goes into your BY statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The var you want the deciles based on goes in your VAR statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a RANK statement to store your Ranks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=apt.nyse out=rnyse groups=10;
	by Year;
	var mrktcap;
        rank rank_mrkt_cap;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Sep 2016 17:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300632#M63515</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-25T17:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300639#M63519</link>
      <description>&lt;P&gt;THanks&amp;nbsp;Reeza&amp;nbsp;this code worked.&amp;nbsp;&lt;BR /&gt;there is another issue . in my data i have two variables Month and year, i want to define a year which start from July and End with june&amp;nbsp;, how can i do this ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks again&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 18:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300639#M63519</guid>
      <dc:creator>raqthesolid</dc:creator>
      <dc:date>2016-09-25T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300642#M63521</link>
      <description>&lt;P&gt;You have to recode this to create a new variable that will resolve to your year of interest.&lt;BR /&gt;Or use a custom format, possibly look at multilabel format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd probably create a new variable using if/then code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 19:36:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300642#M63521</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-25T19:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create groups by deciles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300775#M63577</link>
      <description>&lt;P&gt;First step when involving date manipulation is often to make sure you have a SAS date value. If you currently have month and year as numeric values then in a datat step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SasDate = mdy(month,1,year);&lt;/P&gt;
&lt;P&gt;creates a date that represents the first day of the month.&lt;/P&gt;
&lt;P&gt;Then a "modified" year such as you have can be made as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NewYearVar = Year(SasDate) + (month(SASDate) ge 7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These two lines should be in the same data step. Pick your own names for SasDate and NewYearVar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Looks like a State Fiscal Year to me).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-groups-by-deciles/m-p/300775#M63577</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T15:03:24Z</dc:date>
    </item>
  </channel>
</rss>

