I have data that resembles the following (it is at the individual level):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(year GDPrate age22 individual) 1990 3 1982 1 1991 4 1983 2 1992 5 1990 3 1993 1 1992 4 1994 2 1993 5 1995 3 1994 6 1996 3 1995 7 1997 1 1996 8 1998 2 1997 9 1999 1 1998 10 2000 2 1999 11 end
Code:
set more off tempfile master save `master' keep year GDPrate duplicates drop rename (year GDPrate) (age22 GDPrate22) merge 1:m age22 using `master' drop _merge
Is there a cleaner way of doing this? I feel that I am missing something doing this in this manner- in particular, when I do this for the state level (GDP growth at the state level), I get a lot of missing values in the merge.
Kind Regards,
CS
0 Response to Merging based on older values of a variable
Post a Comment