Title

_rm_matrix_rclist --
evaluates a list of names or a numlist to create a selection
vector and a list of names that can be used
to extract information from a matrix.

Syntax

_rm_matrix_rclist
,
options
[
options
]

Required

rcnames(matrix-names) is a string with
the names of the rows or columns from the matrix where you want to
select elements.

rclist(names|numlist) names is a string with
names corresponding to row or column names in the matrix where you want to
make a select. If numlist is used, you can specify the row or column
numbers that you want to select.

Optional

rclabels(labels) A string with
labels that will be assigned to the names or numbers in rclist().

quietly Suppress display of error message.
r(error) is returned.

unab Unabbreviate the names in rc-list using
fvexpand

Description

_rm_matrix_rclist is a programmer's tool for evaluating a list to
select rows or columns from a matrix. You provide the row or column names
from the matrix and either a numerical list of rows/columns or names of the
rows/columns. The command returns a selection vecto of which rows/columns
of the matrix you want to select; this can be used by _rm_matrix_select.
It also provides a vector of indices for the selected rows and columns that
can be used by _rm_matrix_index. A local with the names of the
selected columns is also returned. Optionally you can provide a string
of labels that will replace the row/column labels currently in the matrix;
this allows you to easily assign more useful labels.

Saved results

_rm_matrix_rclist saves in s():

Macros:

s(error) 1 indicates error decoding list.

s(isnumlist) 1 if selection made using numlist.

s(newnames) Names for the selected elements.

Matrices:

s(selectmat) A row vector with one column for each
name in rcnames. A 1 indicates that element was selected; a
0 that it was not.

s(indexmat) A row vector with one column for each
element of rcnames that was selected.

Also see

_rm for other _rm programming commands.