I want to generate the next set of years in a dataset when the years are not consecutive.
For example, I would like to generate 2003 and 2005 for each state in the panel dataset. How would I go about doing this?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int year str20 state str7 fips double(mjnotused mjpastyruse) float(mjadcry mjadpry mjadcr mjadpr mjadany rml) 2002 "Alabama" "1" 6546000 601000 0 0 0 0 0 0 2004 "Alabama" "1" 6651000 621000 0 0 0 0 0 0 2006 "Alabama" "1" 682000 101000 0 0 0 0 0 0 2008 "Alabama" "1" 6850000 640000 0 0 0 0 0 0 2010 "Alabama" "1" 6942000 697000 0 0 0 0 0 0 2012 "Alabama" "1" 6962000 816000 0 0 0 0 0 0 2014 "Alabama" "1" 7143000 728000 0 0 0 0 0 0 2015 "Alabama" "1" 7194000 680000 0 0 0 0 0 0 2016 "Alabama" "1" 7054000 812000 0 0 0 0 0 0 2017 "Alabama" "1" 6864000 1039000 0 0 0 0 0 0 2018 "Alabama" "1" 6752000 1182000 0 0 0 0 0 0 2019 "Alabama" "1" 6553000 1186000 0 0 0 0 0 0 2002 "Delaware" "10" 17891000 1998000 0 0 0 0 0 0 2004 "Delaware" "10" 9636000 1099000 0 0 0 0 0 0 2006 "Delaware" "10" 1221000 153000 0 0 0 0 0 0 2008 "Delaware" "10" 1256000 157000 0 0 0 0 0 0 2010 "Delaware" "10" 1255000 196000 0 0 0 0 0 0 2012 "Delaware" "10" 1292000 205000 0 0 0 0 0 0 2014 "Delaware" "10" 1335000 204000 0 0 0 0 0 0 2015 "Delaware" "10" 1345000 209000 0 0 0 0 0 0 2016 "Delaware" "10" 1327000 241000 0 0 0 0 0 0 2017 "Delaware" "10" 1302000 282000 0 0 0 0 0 0 2018 "Delaware" "10" 1306000 294000 0 0 0 0 0 0 2019 "Delaware" "10" 1292000 276000 0 0 0 0 0 0 end
Comment