<?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: A code to create a new variable in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680653#M32739</link>
    <description>&lt;P&gt;What does your data look like? What have you tried already?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 09:34:40 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-09-01T09:34:40Z</dc:date>
    <item>
      <title>A code to create a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680645#M32738</link>
      <description>&lt;LI-SPOILER&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Kindly, I would like to create a code that measures sales volatility (SalesVol) which is computed as the standard deviation of annual sales (sales) divided by the average total assets (AvgTA) over the prior seven years (requiring at least three non-missing observations).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your assistance is highly appreciated.&lt;/LI-SPOILER&gt;</description>
      <pubDate>Tue, 01 Sep 2020 08:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680645#M32738</guid>
      <dc:creator>Almutairi</dc:creator>
      <dc:date>2020-09-01T08:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: A code to create a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680653#M32739</link>
      <description>&lt;P&gt;What does your data look like? What have you tried already?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 09:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680653#M32739</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-09-01T09:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: A code to create a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680910#M32741</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to calculate the average but failed to do the standard deviation of the new variable (SalesVol) over the previous seven years (requiring at least three non-missing observations). I am attaching a sample of my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data=data1; by ID year; &lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data=data1; by id year;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; data1 (compress=yes); set data1; by ID year;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n+&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.id then n=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;lag_TA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lag(TA);&lt;/P&gt;&lt;P&gt;if n = &lt;STRONG&gt;1&lt;/STRONG&gt; then do; lag_TA =&lt;STRONG&gt;.&lt;/STRONG&gt;; end;&lt;/P&gt;&lt;P&gt;AvgTA =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (TA+ lag_TA)/&lt;STRONG&gt;2&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;SalesVol = sales/ AvgTA;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/680910#M32741</guid>
      <dc:creator>Almutairi</dc:creator>
      <dc:date>2020-09-02T10:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: A code to create a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/681852#M32770</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I still have not received an answer to my question. Can anyone help, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 07:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/681852#M32770</guid>
      <dc:creator>Almutairi</dc:creator>
      <dc:date>2020-09-06T07:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: A code to create a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/681853#M32771</link>
      <description>&lt;P&gt;Start by providing usable example data in a data step with datalines, so we can recreate your data with a simple copy/paste and submit. Excel spreadsheets tell us nothing about column attributes, and are not downloadable in corporate environments where security measures block them.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 08:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/A-code-to-create-a-new-variable/m-p/681853#M32771</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-06T08:19:14Z</dc:date>
    </item>
  </channel>
</rss>

