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
mixed model with a baseline differencesDear all, I have a data set of 70 patient in a intervention foloow up study. 4 of the patient did d…
Sorting string variable fromDear All, I'm having hassle sorting a string variable. Even after using the Code: sort code, the en…
sample used by teffects matching estimatorsDoes the teffects suite of commands include a command showing how many records at each treatment lev…
matching FrontierI wonder if anyone has attempted a Stata version of the matching Frontier program of King et al. The…
number of records teffects matching estimators use to estimate effectsHow can I identify the number of records at each treatment level the teffects matching estimators us…
Subscribe to:
Post Comments (Atom)
0 Response to Reorder a matrix columns according to the values of one of its rows
Post a Comment