Date: Mon, 30 Sep 2002 15:19:12 -0400
Reply-To: Asheber Sewalem <sewalem@CDN.CA>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Asheber Sewalem <sewalem@CDN.CA>
Subject: Lag
Content-Type: text/plain; charset="iso-8859-1"
Can anybody tell me the opposite of the lag function
Here is the sample data with variables id, yr and x1. I want to create
another variable within id, that is x2 as shown below.
Data one;
id yr x1
25 1991 25
25 1992 24
25 1993 30
26 1995 41
26 1996 45
26 1997 39
Here is the desired output
id yr x1 x2
25 1991 25 24
25 1992 24 30
25 1993 30 0
26 1995 41 45
26 1996 45 42
26 1997 42 39
26 1998 39 0
Thanks
Asheber
|