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 (July 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 23 Jul 2004 20:34:25 -0400
Reply-To:     Thomas <tythong@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Thomas <tythong@YAHOO.COM>
Subject:      Last. minus First.

Hi all,

I have a dataset as belows, how do I compute the (Last.x - First.x), last value of x minus first value of x, for each id? The input and desired output are attached as belows.

Thanks a lot! Thomas

*input; id x x1 x2 a 10 0.5 0.9 a 11 0.55 0.8 a 12 0.5 0.6 a 13 0.45 0.55 b 1 0.1 0.15 b 2 0.2 0.25 b 3 0.15 0.2

*expected output; id x x1 x2 diff a 10 0.5 0.9 3 a 11 0.55 0.8 3 a 12 0.5 0.6 3 a 13 0.45 0.55 3 b 1 0.1 0.15 2 b 2 0.2 0.25 2 b 3 0.15 0.2 2


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