------------------------------------------------------------------------------- help formatsusort-------------------------------------------------------------------------------

Sort rows or columns of matrix according to row or column summaries

matsusortinput_matrixoutput_matrix[,columnsdecreasesummary(statistic)]

Description

matsusortby default sorts rows ofinput_matrixaccording their order by some numeric summary (by default, the mean of the elements in each row) and puts the resulting matrix intooutput_matrix.input_matrixandoutput_matrixmay have the same name.

matsusortwith thecolumnsoption sorts columns ofinput_matrixaccording their order by some numeric summary (by default, the mean of the elements in each column) and puts the resulting matrix intooutput_matrix.input_matrixandoutput_matrixmay have the same name.

Options

columnsspecifies that columns should be sorted, not rows as is the default.

decreasespecifies that rows and/or columns should be sorted in decreasing order of the numeric summary. The default is increasing order.

summaryspecifies a summary statistic. The argument must be one of the results left behind by summarize, that is, one ofN mean sum sum_wmin max sd Var p1 p5 p10 p25 p50 p75 p90 p95 p99 skewness kurtosis.

Examples

. matsusort A B

. matsusort A B, su(max)

AuthorNicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

Also see