I have a matrix A in STATA and I want to obtain a new matrix B with the same contents as A but with its columns reordered according to the values of a given row.
For example, if A looks like:
1 2 3
6 8 7
I want to reorder this based on the second row to obtain B:
1 3 2
6 7 8
Is there a straightforward way of doing this in STATA without having to use MATA commands? I'm not familiar with them but willing to learn if needed.
Related Posts with Reorder a matrix columns according to the values of one of its rows
Area under ROC and clogit?Is it possible -- or appropriate -- to calculate area under ROC when running a conditional logit? If…
Linear mixed effects with unbalanced, survey-weighted, longitudinal dataHello, I have panel household survey data that is a longitudinal study of individuals, so an unbalan…
Year IndexHi, I have a panel data from 2003-2018. I have taken the average of (Top Marginal Income Tax from 2…
Question of fixed effects NThis is an embarrassing question, but I would appreciate an answer. I have a panel of individuals s…
tabm varlist output takes the variable labelsHi, When I execute Code: tabm variables , the outputs take the variable labels instead of variab…
Subscribe to:
Post Comments (Atom)
0 Response to Reorder a matrix columns according to the values of one of its rows
Post a Comment