Date: Fri, 12 May 2006 18:40:47 -0700
Reply-To: mshall2@GMAIL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: mshall2@GMAIL.COM
Organization: http://groups.google.com
Subject: Simple Event history, 'ever occur' question
Content-Type: text/plain; charset="iso-8859-1"
I'm with working a large dataset (N=~220,000) that has observations for
48 months. I am computed a migration history, and I have already
established when a migration has occurred. I am trying create a
variable that indicates whether a migration occured any time in the
past. Here's an example (in long form) of what I want the data to look
like:
t is time, inter is occurence of (interstate) migration, and intermig
is the 'migrant' variable.
t inter intermig
1 0 0
2 0 0
3 1 1
5 0 1
6 0 1
7 0 1
Here's a portion of the code (the data is currently in wide form) I've
written so far, but the problem I'm running into is that a preceeding
ever migrant value of 0 will override subsequent values. Nobody can
move during the first month so the line ' intermig[1]=0' confirms this.
array intermig(48); /*Inter mig occured at t or any t prior (t-k)*/
array inter {1:48} interstate_move1-interstate_move48;
intermig[1]=0;
do i=2 to 48;
/*Interstate Migrants*/
if inter[i] eq 1 then intermig[i]=1;
if inter[i] ne 1 then intermig[i]=0;
intermig[i]=intermig[i-1];
I realize this is a very novice question, but it's been bothering me
all evening. Thanks much for any help you can provide.
Matt Hall
Penn State