|
At 04:46 PM 8/30/2006, [Ela Bonbevan] wrote:
>I have 2 datasets which have MANY variables that contain dates -
>essentially activities of individuals over a 20 year period.
>
>I would like to compare the 2 datasets, but one of the sets was
>obtained roughly 6 months after the first dataset so it contains more
>recent records. I want to set a data cut of point equal to the most
>recent record in the first dataset and then write some syntax to fill
>all of the dates past the cutoff as sysmis in dataset 2.
You've seen Gene's suggestion, which I think is about as well as you
can do.
(Although, Gene, where you have
+ Do repeat in=d1 d2 d3.
+ if (in lt date.mdy(mm,dd,yyyy)) in=$sysmis.
+ End repeat.
should it be 'GT' instead of 'lt'? I think the goal was to blank
variables after the cutoff date.)
Now, Ela, you have "2 datasets which have MANY variables that contain
dates - essentially activities of individuals over a 20 year period."
If I have that right, each record records a lot of different events.
This is called 'wide' organization. Without giving all the details and
reasons now, 'long' organization, with a separate record for each
event, is much easier to do most things with. I'll conjecture that
includes your comparison of the two datasets. VARSTOCASES is pretty
good for converting 'wide' files to 'long'.
|