Dear All, I found this question somewhere, and wish to see your suggestion on how to calculate the value of interest. The data set is
There are three regions (region=A,B,C), and two year (year=2003, 2004). Four industries (nlmy, ck, zhz, dl) are included. For each year, I'd like to calculate the value DIVI as displayed below:
where i, j denotes region (A,B,C), t denotes year (2003,2004), k denotes industry (nlmy, ck, zhz, dl), and `abs' means absolute value. Thank you in advance.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str12 region int year float(nlmy ck zhz dl) "A" 2003 2.91 2.46 102.21 3.78 "A" 2004 2.98 2.16 105.08 6.28 "B" 2003 .97 6.97 77.17 3.55 "B" 2004 .87 7.69 76.81 3.07 "C" 2003 9.09 28.1 126.72 16.75 "C" 2004 8.64 27.87 121.54 17.14 end
where i, j denotes region (A,B,C), t denotes year (2003,2004), k denotes industry (nlmy, ck, zhz, dl), and `abs' means absolute value. Thank you in advance.
Comment