<?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 for quarterly data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14619#M2387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you need it?&amp;nbsp; If you are going to exclude missing values, why would you want to replace them with interpolated values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2012 01:28:45 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-27T01:28:45Z</dc:date>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14616#M2384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good days to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable, return on assets (ROA) financial years 2003 to 2010 for US firms. I would like to calculate performance volatility (=standard deviation of ROA for 3 years) using quarterly data. It does mean that there will be (4 qtrs x 3 years &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; maximum ROA of 12 quarters for the calculation of standard deviation.&lt;/P&gt;&lt;P&gt;fyearq = financial year&lt;/P&gt;&lt;P&gt;fqtr = quarter of the financial year (there are 4 quarters per annum)&lt;/P&gt;&lt;P&gt;tic = ticker number (company identification codes)&lt;/P&gt;&lt;P&gt;datafqtr = financial year + quarter&lt;/P&gt;&lt;P&gt;ROA = return on asset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to calculate performance volatility for the following years:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year 2003 = standard deviation of ROA in 3 years (overlapping period 2003 - 2005)&lt;/P&gt;&lt;P&gt; year 2004 = standard deviation of ROA in 3 years (overlapping period 2004 - 2006) &lt;/P&gt;&lt;P&gt;year 2005 = standard deviation of ROA in 3 years (overlapping period 2005 - 2007) &lt;/P&gt;&lt;P&gt;year 2006 = standard deviation of ROA in 3 years (overlapping period 2006 - 2008)&lt;/P&gt;&lt;P&gt;year 2007 = standard deviation of ROA in 3 years (overlapping period 2007 - 2009) &lt;/P&gt;&lt;P&gt;year 2008 = standard deviation of ROA in 3 years (overlapping period 2008 - 2010)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;additional rules:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. if there is missing value is found in between/at the middle of the overlapping period, the standard deviation calculation shouldn't be affected (ie. the standard deviation value should be derived).&lt;/P&gt;&lt;P&gt;2. If missing value is found at the begining/ending of the year, the standard deviation calculation should be ignored (ie. should not be derived). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you and hope to get some valuable response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mspak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14616#M2384</guid>
      <dc:creator>mspak</dc:creator>
      <dc:date>2012-02-27T01:09:21Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14617#M2385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always use the intnx function to get the starting and ending dates (see: &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212700.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212700.htm&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and set the value to missing if you don't have a non-missing value for those dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary might be the easiest way to do the calculations and will ignore missing values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14617#M2385</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-27T01:21:15Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14618#M2386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can proc expand helpful? Can SAS read the id as YYYYQQ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used proc expand for calculation of lag values. I know this function can calculate the lead values too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also think about another way - using FIRST. and LAST. function. But I do not know how this function apply to both tic and quarter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;mspak &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14618#M2386</guid>
      <dc:creator>mspak</dc:creator>
      <dc:date>2012-02-27T01:27:01Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14619#M2387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you need it?&amp;nbsp; If you are going to exclude missing values, why would you want to replace them with interpolated values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14619#M2387</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-27T01:28:45Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14620#M2388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to calculate the standard deviation of ROA for a given firm for 3 years period. As all the ROA are arranged in a column,&amp;nbsp; I must identify the first and last ROA used to calculate the standard deviation. Therefore, I feel that FIRST. and LAST. might be useful for data cleaning before the SD calculation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or I also consider to arrange the ROA in (8 years x 4 qtrs) 32 columns using proc expand&amp;nbsp; for easy calculation of SD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 01:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14620#M2388</guid>
      <dc:creator>mspak</dc:creator>
      <dc:date>2012-02-27T01:37:07Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14621#M2389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or simply select records between x and y.&amp;nbsp; According to your specs, if you don't have a record for both x and y, then you are not supposed to calculate the SD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 02:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14621#M2389</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-27T02:01:10Z</dc:date>
    </item>
    <item>
      <title>standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14622#M2390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This query does the trick: it excludes all cases where at least one of the missing ROA values occurs on a first quarter (fqtr=1) . Otherwise, it calculates the standard deviations from all non-missing ROA values. There are 33661 std values returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data beginnings;&lt;BR /&gt;input begYear @@;&lt;BR /&gt;datalines;&lt;BR /&gt;2003 2004 2005 2006 2007 2008&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Roa2Std as&lt;BR /&gt;select tic, begYear, std(ROA) as RoaStd&lt;BR /&gt;from fPath.Roa2, beginnings&lt;BR /&gt;where fyearq between begYear and begYear+2&lt;BR /&gt;group by tic, begYear&lt;BR /&gt;having sum(ROA is not missing or fqtr ne 1) = 12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 02:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/14622#M2390</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-27T02:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: standard deviation for quarterly data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/474647#M71102</link>
      <description>&lt;P&gt;proc sql;&lt;BR /&gt;create table exe_ccn_lancmpcrsp as&lt;BR /&gt;select a.*,std(b.RET)*sqrt(250) as lstkvol "lag annualized stock volitality"&lt;BR /&gt;from exe_ccn_lancmpllq a left join crspa.DSF b&lt;BR /&gt;on a.lpermno=b.permno and b.DATE between a.lfybegdt and a.lfyenddt&lt;BR /&gt;group by a.lpermno,a.fyear&lt;BR /&gt;having sum(b.RET is not missing)&amp;gt;1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;I use the same method as suggest to obtain stock volitality from crsp daily stock file. But my problem is that the observations go from 36 thousand to more than 1 billion. And there are many same results, with same lpermno, same fyear and same lstkvol. I couldn't find the reason. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 08:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/standard-deviation-for-quarterly-data/m-p/474647#M71102</guid>
      <dc:creator>zilong567</dc:creator>
      <dc:date>2018-06-30T08:24:22Z</dc:date>
    </item>
  </channel>
</rss>

