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 (August 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 4 Aug 2008 14:30:39 -0400
Reply-To:   KNuak <asom77@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   KNuak <asom77@HOTMAIL.COM>
Subject:   SAS code for last minus first
Content-Type:   text/plain; charset=ISO-8859-1

I have dataset1 below comprising id and height(ht). I want to compute the difference in height for each id given by last minus first height.

For id 29, I have difference in height to be: last ht – lst ht ie. 355- 188 = 167(dataset2) For id 31, I have difference in height to be: last ht – lst ht ie. 203- 112 = 91(dataset2)

At the end I expect to have dataset 2 with the difht computed.

What SAS code will help me find the difference between first and last height for each id, please? I have 70 different ids to find the difference between the first and last height.

Dataset1: id ht 29 188 29 310 29 355 31 112 31 156 31 186 31 203

Dataset 2: id ht difht 29 188 29 310 29 355 167 31 112 31 156 31 186 31 203 91


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