Hi I need a small data management trick that i am assuming it is easier in Mata than Stata.
assume we have that stacking format:
expected output Mata Matrix would be:
first column = unique i
follows columns be the J pair, but descendant ordered by similarity from left to right
thks in advance.
assume we have that stacking format:
Code:
clear input int(i j) byte similarity 9 43 25 28 67 21 28 43 26 89 124 21 89 160 21 89 123 21 89 167 21 89 125 22 89 161 22 89 154 22 89 90 22 89 157 22 89 162 23 end
first column = unique i
follows columns be the J pair, but descendant ordered by similarity from left to right
9 | 43 | |||
28 | 43 | 67 | ||
89 | 162 | 157 | 90 | ... |
Comment