Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | David Torres <torresd@umich.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: backfill missing data |
Date | Tue, 24 Aug 2010 11:55:58 -0400 |
I've concatenated unformatted date variables for each year and job number so that start and finish dates for a job are carried back together. Every pair of numbers, then, including the space in between, represent a start and finish date. All dates here, though for example purposes only, are year specific. An example of what I have, then, is:
pubid stfin1_1998 stfin2_1998 stfin1_1999 stfin2_1999 stfin1_2000 stfin2_2000 1 13901 14200 14100 14200 14247 14590 2 13890 14198 14310 14525 3 14000 14208 14311 14915 4 13883 14650 14351 14600 14635 14900For pubid 1, the values in stfin1_2000 would be copied to stfin1_1999 as it applies to that year. The same goes for pubid 2. In pubid 3, stfin1_2000 should be copied to stfin1_1998 as it applies to that year; stfin2_2000 should be copied to stfin1_1999 since it applies to that year. In pubid 4, stfin1_1999 should be copied to stfin1_1998. I only mean to copy follow-up year information to cells for which current year information is missing, or ". ."
Is there an easy way to do this across several years and job numbers at the same time? Perhaps using a foreach command?
Cheers, -------------------------------------------- David Diego Torres, MA(Sociology) PhD Candidate in Sociology 2044 Population Studies Center University of Michigan Institute for Social Research Ann Arbor MI 48106-1248 Tel 734.763.4098 Fax 734.763.1428 torresd at umich dot edu * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/