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