Good Evening,
I have a large dataset that ends in 2006, however, I would like to add extra years to the data (up to 2012). I tried to look through the forum and online, but I haven't found much. Besides the origin, I actually do not want to add any observations (at the moment) to the data. In other words, I want to add extra rows by years and origin.If I try to do this manually on excel (or another format) it will take a lot of time seeing that there are about 500,000+ rows. So, I'm trying to see if I can find an easier way.
In other words, I want it to look like the following:
2003 "China" 0 4 0
2004 "China" 4 0 0
2005 "China" 4 2 0
2006 "China" 2 0 0
2007 "China"
2008 "China"
2009 "China"
2010 "China"
2011 "China"
2012 "China"
I tried to play around with carryforward but get "repeated time values in sample" error when I used tsset with the year.
Regards.
I have a large dataset that ends in 2006, however, I would like to add extra years to the data (up to 2012). I tried to look through the forum and online, but I haven't found much. Besides the origin, I actually do not want to add any observations (at the moment) to the data. In other words, I want to add extra rows by years and origin.If I try to do this manually on excel (or another format) it will take a lot of time seeing that there are about 500,000+ rows. So, I'm trying to see if I can find an easier way.
Code:
input int year str34 origin long(totalpersonspendingstartyear appliedduringyear rejected) . "" . . . 2003 "China" 0 4 0 2004 "China" 4 0 0 2005 "China" 4 2 0 2006 "China" 2 0 0
2003 "China" 0 4 0
2004 "China" 4 0 0
2005 "China" 4 2 0
2006 "China" 2 0 0
2007 "China"
2008 "China"
2009 "China"
2010 "China"
2011 "China"
2012 "China"
I tried to play around with carryforward but get "repeated time values in sample" error when I used tsset with the year.
Regards.
Comment