Date: Wed, 13 Nov 1996 18:46:38 -0500
Reply-To: tegenaw@ACSU.BUFFALO.EDU
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: tegenaw@ACSU.BUFFALO.EDU
Organization: University at Buffalo
Subject: How to select data groups with n consecutive obs.?
I have a dataset which contains m groups of yearly observations. The
dataset is sorted by GROUP and YEAR but for a givem group the yearly
observations may not be consecutive. Since I am using time series to
analyse the data groups, I need to select observations from
dataset based on two criteria:
(1) Select only groups with n consecutive obs.
(2) For each group selected, take only the n consecutive obs.
Could any one give me a hint on how to do this? The dataset has the
following structure (after sorting by group and year):
GROUP YEAR
g1 1983
g1 1985
g1 1986
g1 1987
... ...
... ...
g1 1990
g1 1992
g2 1984
... ...
g2 1995
... ...
gm 1985
... ...
gm 1996
thanks,
tegenaw
|