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:   Sat, 13 May 2006 10:14:22 -0700
Reply-To:   Matt <mshall2@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Matt <mshall2@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Event History Part II
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

I am compiling a migration history database using SIPP data for about 220,000 respondents over 48 months. I have a monthly indicator (inter[i]) of whether a migration occured or not, and I have computed a variable (intermig[i]) that represents whether a migration has occurred in the past. I now need to compute a measure of the date of migration, and have that variables stay be constant by migration. Here's an example of what I want the data to look like (in long format).

t inter intermig cminter interview 0 0 0 0 616 1 0 0 0 617 2 1 1 618 618 3 0 1 618 619 4 0 1 618 620 5 0 1 618 621 6 0 1 618 622

My data is currently in wide format and so the code below effectively creates 'intermig,' but the second part where cminter is computed does not work, and I get zeros on all obs. Is SAS not able to process the cminter[j]=interview[i] command? Thanks for your help.

/*Interstate Migrants*/ do i=2 to 48; if inter[i] eq 1 then do; do j=i to 48; intermig[j]=1; end; leave; end; else intermig[i]=0;

if inter[i] eq 1 then do; do j=i to 48; cminter[j]=interview[i]; end; leave; end; else cminter[i]=0; end;


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