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
New version of wridit on SSCThanks as always to Kit Baum, a new version of the wridit package is now available for download from…
gtfpch and teddf - Malmquist–Luenberger productivity indexHi I have been trying to use the gtfpch command in STATA 17, but I am continually returning the sam…
Aggregate BigData in Stata (similar to the Excel Function Pivot Tables)Hello guys, I am complete new in working with Stata and I tried to figure out how to aggregate a hu…
Running time for QUAIDSHi, I'm currently running QUAIDS estimation for 300K households and 215 food items. I wonder how lon…
Problems collect commandHi all, I would like to use the collect command to customise how my regression table looks. However…
Subscribe to:
Post Comments (Atom)
0 Response to Reorder a matrix columns according to the values of one of its rows
Post a Comment