Hello, I have data with total values for a given code. For example, for code1="0129", the total value of transaction is (value1) 7560000. Similarly, for code2="0168", the total value of transaction is 897000.
Code1 and Code2 have many to many relationships, at times more complex than the posted data show.
Given the total values, is there a way to generate a weight matrix to help identify what share of 0342 (code1) is going into 0342 (code2)? In other words, is there a way to generate weights for each unique combination of code1 and code2?
Many thanks.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float year str4(code1 code2) double(value1 value2) 1988 "0129" "0168" 7560000 8957000 1988 "0149" "0168" 397668016 8957000 1988 "0149" "0173" 397668016 22163000 1988 "0149" "0174" 397668016 114397000 1988 "0149" "0175" 397668016 169517000 1988 "0149" "0176" 397668016 86599000 1988 "0149" "0179" 397668016 3329000 1988 "0342" "0342" 142146000 127989000 1988 "0344" "0342" 299409000 127989000 1988 "0343" "0345" 37468000 52547000 1988 "0342" "0345" 142146000 52547000 1988 "0149" "0981" 397668016 10590000 end
Comment