Sort a matrix .-
^matsort^ matname sortcolumn direction replace/rankonly
Description -----------
^matsort^ is a routine to sort a matrix by a given column. All columns, along > with the column name, are re-arranged.
Arguments --------- ^sortcolumn^ indicates the column to use for sorting. The default is 1. ^direction^ can be either "up" (for increasing) or "down" for decreasing. Th > e default is "up". ^rankonly^ A flag that indicates that the original matrix will not be changed > . The rank order is stored in r(rank) - see return list ^replace^ A flag that indicates that the original matrix will contain sorted > values. This is the default.
Examples -------- . ^matsort^ mymat 1 "up"
Author: Paul Millar www.ucalgary.ca/~pemillar/stata.htm pemillar@@ucalgary.ca See also: --------- Online: help for @matvsort@ (if installed)