Stata 15 help for matrix_list

[P] matrix utility -- List, rename, and drop matrices


List matrix names

matrix dir

List contents of matrix

matrix list mname [, noblank nohalf noheader nonames format(%fmt) title(string) nodotz]

Rename matrix

matrix rename oldname newname

Drop matrix

matrix drop { _all | mnames }


matrix list

Data > Matrices, ado language > List contents of matrix

matrix rename

Data > Matrices, ado language > Rename matrix

matrix drop

Data > Matrices, ado language > Drop matrices


matrix dir lists the names of currently existing matrices. matrix list lists the contents of a matrix. matrix rename changes the name of a matrix. matrix drop eliminates a matrix.


noblank suppresses printing a blank line before printing the matrix. This is useful in programs.

nohalf specifies that, even if the matrix is symmetric, the full matrix be printed. The default is to print only the lower triangle in such cases.

noheader suppresses the display of the matrix name and dimension before the matrix itself. This is useful in programs.

nonames suppresses the display of the bordering names around the matrix.

format(%fmt) specifies the format to be used to display the individual elements of the matrix. The default is format(%10.0g).

title(string) adds the specified title string to the header displayed before the matrix itself. If noheader is specified, title() does nothing because displaying the header is suppressed.

nodotz specifies that .z missing values be displayed as blanks.


. mat b = (2, 5, 4\ 5, 8, 6\ 4, 6, 3) . mat a = (1, 2 \ 2, 4) . matrix dir . matrix rename a z . matrix dir . matrix list b . matrix list b, nohalf . matrix drop b . matrix dir . matrix drop _all . matrix dir

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index