Hello,
I have data where it has information for the years 1980, 1990, 2000, 2010, and 2020. But, the value of the desired variables remain the same for every decade from 2000-to 2010 and 2010-to 2020. To merge with my panel ( from 2000-2020 ) data I need to create additional years from 2000, 2001, 2002, 2003, 2004, 2005 to 2020 for each county with the same variable for each decade. Just with the modification of creating additional 10 years with the same info for each county.
The dataset has thousands of observations. So, if I do it by hand, it will take a lot of time. Is there any way I can do it by coding it?
dataex statefips cntyfips year
----------------------- copy starting from the next line -----------------------
I have data where it has information for the years 1980, 1990, 2000, 2010, and 2020. But, the value of the desired variables remain the same for every decade from 2000-to 2010 and 2010-to 2020. To merge with my panel ( from 2000-2020 ) data I need to create additional years from 2000, 2001, 2002, 2003, 2004, 2005 to 2020 for each county with the same variable for each decade. Just with the modification of creating additional 10 years with the same info for each county.
The dataset has thousands of observations. So, if I do it by hand, it will take a lot of time. Is there any way I can do it by coding it?
dataex statefips cntyfips year
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float statefips int cntyfips float year 1 13 90 1 13 20 1 13 00 1 13 10 1 13 80 1 17 00 1 17 20 1 17 80 1 17 90 1 17 10 1 21 80 1 21 90 1 21 10 end

Comment