<?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 Standard Deviation and Rank Transformation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444417#M23321</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello SAS Support Communities,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;I have attached dataset comp16f.&amp;nbsp; Please send me a code I can use to do the following:&lt;/DIV&gt;
&lt;DIV&gt;1. Standard deviation of ib1 for three years at a time.&amp;nbsp; Ib1 is the current year, lag1 is the prior year, and lag2 is two years before.&amp;nbsp; These are already included for each observation.&lt;/DIV&gt;
&lt;DIV&gt;2. Rank transform the variable created in step 1 between 0 and 1.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thank you so much in advance for your help!&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;God bless, best regards, and take care,&lt;/DIV&gt;
&lt;DIV&gt;Jadallah&lt;/DIV&gt;</description>
    <pubDate>Sat, 10 Mar 2018 17:16:43 GMT</pubDate>
    <dc:creator>jjadall1</dc:creator>
    <dc:date>2018-03-10T17:16:43Z</dc:date>
    <item>
      <title>Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444417#M23321</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello SAS Support Communities,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;I have attached dataset comp16f.&amp;nbsp; Please send me a code I can use to do the following:&lt;/DIV&gt;
&lt;DIV&gt;1. Standard deviation of ib1 for three years at a time.&amp;nbsp; Ib1 is the current year, lag1 is the prior year, and lag2 is two years before.&amp;nbsp; These are already included for each observation.&lt;/DIV&gt;
&lt;DIV&gt;2. Rank transform the variable created in step 1 between 0 and 1.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thank you so much in advance for your help!&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;God bless, best regards, and take care,&lt;/DIV&gt;
&lt;DIV&gt;Jadallah&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Mar 2018 17:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444417#M23321</guid>
      <dc:creator>jjadall1</dc:creator>
      <dc:date>2018-03-10T17:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444453#M23322</link>
      <description>&lt;P&gt;Instead of asking for code, you need to try to do this yourself, and if you can't get it, post your code so we can help you fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Standard deviations are simple to compute in SAS, using data step or PROC SUMARY; and rank transformations can be done with PROC RANK.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 20:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444453#M23322</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-10T20:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444467#M23323</link>
      <description>&lt;P&gt;Hi Paige,&lt;/P&gt;
&lt;P&gt;Thank you for your response.&amp;nbsp; I tried the following code:&lt;/P&gt;
&lt;P&gt;PROC EXPAND DATA=dissert1.comp16f OUT=dissert1.comp16g;&lt;BR /&gt;CONVERT ib1=std / TRANSFORMOUT=(MOVSTD 3);&lt;BR /&gt;by gvkey;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would expect results to only show for firms that have a minimum of three observations.&amp;nbsp; However, there are values for firms with two observations.&amp;nbsp; What do you think?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;God bless, best regards, and take care,&lt;/P&gt;
&lt;P&gt;Jadallah&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444467#M23323</guid>
      <dc:creator>jjadall1</dc:creator>
      <dc:date>2018-03-10T21:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444468#M23324</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Ib1 is the current year, lag1 is the prior year, and lag2 is two years before.&amp;nbsp; These are already included for each observation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I cannot open your zip file with the data, so I am going by the description of the data you stated and which I have quoted above. PROC EXPAND would work if you have each value of the three years in separate rows. But you state that the values you need are included for each observation. Thus, you need the STD function. Something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;_3year_std = std(lb1,lag1,lag2);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444468#M23324</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-10T21:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444474#M23325</link>
      <description>&lt;P&gt;Thank you again Paige!&lt;/P&gt;
&lt;P&gt;I got the same answer with the following three codes:&lt;/P&gt;
&lt;P&gt;PROC EXPAND DATA=dissert1.comp16f OUT=dissert1.comp16h;&lt;BR /&gt;CONVERT ib1=std / TRANSFORMOUT=(MOVSTD 3);&lt;BR /&gt;by gvkey;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table dissert1.comp16g as&lt;BR /&gt; select *,(select std(ib1) from dissert1.comp16f where fyear between a.fyear-2 and a.fyear and gvkey=a.gvkey) as rolling_std&lt;BR /&gt; from dissert1.comp16g as a;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dissert1.comp16f1;&lt;BR /&gt;set dissert1.comp16f;&lt;BR /&gt;_3year_std = std(ib1,lag1,lag2);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For proc rank, I did the following:&lt;/P&gt;
&lt;P&gt;proc rank data=dissert1.comp16g out=dissert1.comp16h;&lt;BR /&gt; var _3year_std;&lt;BR /&gt; ranks Finish;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I convert the finish variable from 0 to 1?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444474#M23325</guid>
      <dc:creator>jjadall1</dc:creator>
      <dc:date>2018-03-10T21:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444484#M23326</link>
      <description>&lt;P&gt;In PROC RANK, use the GROUPS=100 option. This gives numbers on the 0 to 100 scale.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 23:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444484#M23326</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-10T23:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Standard Deviation and Rank Transformation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444500#M23327</link>
      <description>&lt;P&gt;Great job Paige!&amp;nbsp; Thank you so much for your help!&amp;nbsp; God bless you and your family!&lt;/P&gt;
&lt;P&gt;Jadallah&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 02:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Standard-Deviation-and-Rank-Transformation/m-p/444500#M23327</guid>
      <dc:creator>jjadall1</dc:creator>
      <dc:date>2018-03-11T02:18:11Z</dc:date>
    </item>
  </channel>
</rss>

