<?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: Lag variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78663#M22650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can, give an example of what you actually want with you data as an output.&amp;nbsp; I am not worrking what you mean by lag of qrt and mgrno, and your statement about lag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example, your qtr of 1980-4 has the mgrno 260 40 times. Do you want the D field lagged by 1 onto each of the 260 fields (so row 1 gets lagged into row 2). Or did you want the data structured as is to be lagged, regardless of the order or MGRNO?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 May 2013 21:54:31 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2013-05-17T21:54:31Z</dc:date>
    <item>
      <title>Lag variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78662#M22649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a lag variable for D based on qtr and mgrno. Obviously LAG doesn't work here because it doesn't recognize different mgrno.&lt;/P&gt;&lt;P&gt;Any ideas on this?&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 21:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78662#M22649</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-05-17T21:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lag variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78663#M22650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can, give an example of what you actually want with you data as an output.&amp;nbsp; I am not worrking what you mean by lag of qrt and mgrno, and your statement about lag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example, your qtr of 1980-4 has the mgrno 260 40 times. Do you want the D field lagged by 1 onto each of the 260 fields (so row 1 gets lagged into row 2). Or did you want the data structured as is to be lagged, regardless of the order or MGRNO?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 21:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78663#M22650</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-05-17T21:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lag variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78664#M22651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I would like to do is to have the Lag Value of D for each mgrno for each stock separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each stock has many investors. I want the lagged value for the particular investor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1981-1&amp;nbsp; 520 AA should have the value of 1980-4 520 AA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1981-1&amp;nbsp; 835 AA should have the value of 1980-4 835 AA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can understand what I mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 22:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78664#M22651</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-05-17T22:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lag variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78665#M22652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort the data in the right order then LAG() function will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by mgrno ticker qtr ;&lt;/P&gt;&lt;P&gt; lagd=lag(d);&lt;/P&gt;&lt;P&gt; if first.ticker then lagd=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 23:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78665#M22652</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-17T23:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lag variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78666#M22653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 May 2013 07:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lag-variable/m-p/78666#M22653</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2013-05-18T07:40:07Z</dc:date>
    </item>
  </channel>
</rss>

