<?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 return volatility-std deviation of return for past 1 year in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120145#M33092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to cacluate std deviation of returns for the past one year for year 2002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have used proc means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=rtnvol.rtnvol std;&lt;/P&gt;&lt;P&gt;by permno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it give me an output listing by permno its std deviation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need the result to be generated in a SAS file-listing std deviation for each firm so that i can merge the data with other data for further processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Condition: company should have at least 200 observations to obtain the std deviation, can you build in this in the program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also: if I need to calculate the std deviation of returns for each firm for financial year for 2003-2010, do i repeat the steps given for each year, or is that a faster manner?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2012 12:32:05 GMT</pubDate>
    <dc:creator>mei</dc:creator>
    <dc:date>2012-05-18T12:32:05Z</dc:date>
    <item>
      <title>return volatility-std deviation of return for past 1 year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120145#M33092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to cacluate std deviation of returns for the past one year for year 2002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have used proc means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=rtnvol.rtnvol std;&lt;/P&gt;&lt;P&gt;by permno;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it give me an output listing by permno its std deviation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need the result to be generated in a SAS file-listing std deviation for each firm so that i can merge the data with other data for further processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Condition: company should have at least 200 observations to obtain the std deviation, can you build in this in the program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also: if I need to calculate the std deviation of returns for each firm for financial year for 2003-2010, do i repeat the steps given for each year, or is that a faster manner?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 12:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120145#M33092</guid>
      <dc:creator>mei</dc:creator>
      <dc:date>2012-05-18T12:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: return volatility-std deviation of return for past 1 year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120146#M33093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand you correctly, and the 'permno' in 'by' statement is the company id, then the following example may give you&amp;nbsp; a hint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=have;&lt;/P&gt;&lt;P&gt;by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=have;&lt;/P&gt;&lt;P&gt;by sex ;&lt;/P&gt;&lt;P&gt;output std= out=want (drop=_:);&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; Good Luck,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 13:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120146#M33093</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-05-18T13:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: return volatility-std deviation of return for past 1 year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120147#M33094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a CLASS statement to avoid a requirement to sort; If you only want the output data set and no print output use PROC SUMMARY as it doesn't create print output by default and the syntax is basically the same as PROC MEANS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc summary data=rtnvol.rtnvol nway;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class permno;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var &amp;lt;list of variables you want summarized&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* direct output to data set*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=want&amp;nbsp; std= n= /autoname autolabel; /* this creates a separate variable for the output for each statistic requested on var line and names them var_StdDev and Var_n.*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;You could then filter any reports from the output data set to include the variables where the _N indicates you have enough records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 15:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120147#M33094</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-05-18T15:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: return volatility-std deviation of return for past 1 year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120148#M33095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear ballardw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used this programming codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc summary data=rtnvol.rtnvol2 nway;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class permno fyear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=rtnvol.rtn_std2002_03&amp;nbsp; std= n= /autoname autolabel;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result generated contain one column with variable _TYPE_=3, what does this mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Note : if i use this prog code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc summary data=rtnvol.rtnvol2 nway;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class permno;&amp;nbsp; /*class fyear not included*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=want&amp;nbsp; std= n= /autoname autolabel;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the _TYPE_=1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 08:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120148#M33095</guid>
      <dc:creator>mei</dc:creator>
      <dc:date>2012-05-25T08:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: return volatility-std deviation of return for past 1 year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120149#M33096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;en. SQL is a good tool for your problem.&lt;/P&gt;&lt;P&gt;Assuming the table is under c:\ .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;libname x v9 'c:\';
proc sql;
create table want as
 select fyear,conm,std(ret) as return_std
&amp;nbsp; from x.Rtnvol
&amp;nbsp;&amp;nbsp; group by fyear,conm ;
quit;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 08:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/return-volatility-std-deviation-of-return-for-past-1-year/m-p/120149#M33096</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-25T08:57:18Z</dc:date>
    </item>
  </channel>
</rss>

