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 (May 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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


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