Dear All, I have this dataset.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte country float year double I float K2007
1 2007 47639371944.1504 1.027757e+12
1 2008 47079741922.4759 1.027757e+12
1 2009 23310776752.8605 1.027757e+12
1 2010 23169892635.7175 1.027757e+12
1 2011 25140632088.3109 1.027757e+12
1 2012 26392333282.9276 1.027757e+12
1 2013 24184560713.7457 1.027757e+12
1 2014 18385377287.1616 1.027757e+12
1 2015 16695019910.2777 1.027757e+12
1 2016  20107616311.306 1.027757e+12
1 2017 23337869852.3111 1.027757e+12
1 2018  26664902464.842 1.027757e+12
2 2007 6067174174.07463 276483178496
2 2008 7784184466.76024 276483178496
2 2009 9714662213.96143 276483178496
2 2010 10608411137.8261 276483178496
2 2011 11446475617.9555 276483178496
2 2012 12774266788.7859 276483178496
2 2013 14026144934.6544 276483178496
2 2014 15551083505.0151 276483178496
2 2015 17012885354.2527 276483178496
2 2016 17710413653.7783 276483178496
2 2017 21146233903.1325 276483178496
2 2018 24973702239.7895 276483178496
end
label values country country
label def country 1 "乌克兰", modify
label def country 2 "乌兹别克斯坦", modify
For each `country', I'd like to generate a variable `K' which is K_t=(1-0.06)*K_{t-1} + I_t. The value of K in year 2007 is K2007. Any suggestions? Thanks.