LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 16 Oct 2011 01:49:32 -0400
Reply-To:     Randy <randistan69@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Randy <randistan69@HOTMAIL.COM>
Subject:      Lagging Groups

Dear All: I need to lag the data set by groups. My data set is as follows:

Date Group VarA 01OCT2011 1 1 01OCT2011 1 1 01OCT2011 1 1 02OCT2011 1 0 02OCT2011 1 0 01OCT2011 2 0 01OCT2011 2 0 02OCT2011 2 1 02OCT2011 2 1 02OCT2011 2 1

The data that I need are as follows:

Date Group VarA LagVarA 01OCT2011 1 1 0 01OCT2011 1 1 0 01OCT2011 1 1 0 02OCT2011 1 0 1 02OCT2011 1 0 1 01OCT2011 2 0 0 01OCT2011 2 0 0 02OCT2011 2 1 0 02OCT2011 2 1 0 02OCT2011 2 1 0

Note: LagVARA on the first date of each group will always = 0. Please Help

Randy


Back to: Top of message | Previous page | Main SAS-L page