Date: Wed, 21 Apr 1999 14:29:23 GMT
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
Organization: Deja News - The Leader in Internet Discussion
Subject: How to dedect frequent sign changes
I am trying to write an efficient SAS code to handle the following question.
Suppose I have a SAS dataset created with ID number and a variable x.
Observations of x consist of consecutive positive numbers followed by
consecutive negative numbers, and then maybe consecutive positive numbers
again. in fact, this is a large data set so such sign changes may occur more
than a number of times. The dataset may look something like this:
What I want to do is to output the observation whenever its sign changes,
i.e., its sign is different from its previous one----such as observation 3, 5,
and 7 in the above dataset.
Can somebody suggest an efficient code for solving this problem?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own