Hi,
I have observations that I want to duplicate for some of the following years only.
For instance, the obs for 2009 is .6491228 and I want to duplicate this value for 2010 and 2011 only. I tried carryforward but this command expands unitl the next observation, which is not what I want. I also tried with expand but I found nothing satisfying.
If possible, I need a code that would allow me to define the precise number of years I need to expand my observation.
I would appreciate any help. Thank you.
I have observations that I want to duplicate for some of the following years only.
For instance, the obs for 2009 is .6491228 and I want to duplicate this value for 2010 and 2011 only. I tried carryforward but this command expands unitl the next observation, which is not what I want. I also tried with expand but I found nothing satisfying.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str52 CountryName float(year boycott) "Brazil" 2007 . "Brazil" 2008 . "Brazil" 2009 .6491228 "Brazil" 2010 . "Brazil" 2011 . "Brazil" 2012 . "Brazil" 2013 . "Brazil" 2014 .6721311 "Brazil" 2015 . "Brazil" 2016 . "Brazil" 2017 . "Brazil" 2018 .
I would appreciate any help. Thank you.
Comment