Hi dear statalists,
There are below the data
First, I am going to divide the current value by the previous values for each column i.e: 6,079.8 /6,037.6 = 1.006989532
6,211.3 /6,079.8 = 1.0216290009 so on and so forth.
Second, I am going to do:
Could anyone assist me to create a pretty shortcut path, please?
Cheers,
Paris
There are below the data
Code:
YEAR CAE CAE CAE CAE 01 02 03 04 2010 6,037.6 1,010.6 534.5 1,360.2 2011 6,079.8 1,090.4 573.0 1,334.9 2012 6,211.3 1,118.0 563.4 1,277.0 2013 6,323.0 1,206.3 553.0 1,162.4 2014 6,417.3 1,213.2 520.5 1,113.1 2015 6,631.7 1,273.0 502.9 1,116.4 2016 6,634.7 1,258.8 570.5 1,121.1 2017 7,074.2 1,265.1 612.4 1,245.6 2018 7,304.7 1,346.9 587.6 1,356.6 2019 7,713.6 1,311.0 646.1 1,326.0 2020 7,754.9 1,300.3 596.1 1,247.2
6,211.3 /6,079.8 = 1.0216290009 so on and so forth.
Second, I am going to do:
Code:
gen Wanted=.
replace wanted=1.600989532 if YEAR==2010 & CAE2==01
replace wanted=1.021629000 if YEAR==2010 & CAE2==01
replace wanted= if YEAR==2010 & CAE2==01
replace wanted= if YEAR==2010 & CAE2==01
.
.
.
replace wanted= if YEAR==2020 & CAE2==04
Cheers,
Paris

Comment