Dear Profs and colleagues,
I am going to divide each column by the first value of that column which is the value for the year 2010. The result should be one in the year 2010.
e.g
Value_10:
11525.832/ 11525.832=1
12170.209 / 11525.832=
12314.61 / 11525.832=
12585.174/ 11525.832=
Value_11:
2769.224 / 2769.224=1
2681.582 / 2769.224=
.
.
.
I started by this code:
Could anyone help me to complete it? Thanks
Cheers,
Paris
I am going to divide each column by the first value of that column which is the value for the year 2010. The result should be one in the year 2010.
e.g
Value_10:
11525.832/ 11525.832=1
12170.209 / 11525.832=
12314.61 / 11525.832=
12585.174/ 11525.832=
Value_11:
2769.224 / 2769.224=1
2681.582 / 2769.224=
.
.
.
Code:
clear
input int Year double(Value_10 Value_11)
2010 11525.832 2769.224
2011 12170.209 2681.582
2012 12314.61 2716.226
2013 12585.174 2758.651
2014 12446.254 2928.394
end
Code:
sort Year
foreach sfx in 10 11 {
generate Def_`sfx' =Value_`sfx'/_n
}
Cheers,
Paris

Comment