help mata elabel_numlist()

Title

elabel_numlist() -- Parse numeric list

Syntax

real colvector
elabel_numlist(string scalar numlist[,
real scalar integer,
real scalar nosysmiss])

real scalar
_elabel_numlist(nlist,
string scalar numlist[,
real scalar integer,
real scalar nosysmiss])

where numlist contains numlist_elements
and may contain sequences of missing value codes, such as
.a/.c and .a(3).o.

The type of nlist is irrelevant and it is replaced
with a real colvector.

Description

elabel_numlist() expands a string scalar that contains a numeric
list including sequence operators. The function returns the same thing as
Stata's numlist command but additionally expands sequences
of (extended) missing value codes, such as .a/.c, treating the
distance between successive missing value codes as 1. If integer!=0,
only integer values are allowed in numlist; if nosysmiss!=0,
system missing values (.) are not allowed in numlist.

_elabel_numlist() does the same thing but places the expanded numeric
list as a real colvector in nlist and returns the error code.

Conformability

elabel_numlist(numlist[, integer, nosysmiss])
input:
numlist: 1 x 1
integer: 1 x 1
nosysmiss: 1 x 1
result: r x 1

_elabel_numlist(nlist, numlist[, integer, nosysmiss])
input:
numlist: 1 x 1
nlist: r x 1
integer: 1 x 1
nosysmiss: 1 x 1
output:
nlist: r x 1

Diagnostics

elabel_numlist() exits with Stata return code 121 if
numlist is not a valid numlist, with return code 126 if
numlist contains noninteger values, and with return code
127 if numlist contains system missing values.

_elabel_numlist() places in nlist, J(0, 1, .) and returns
the respective error code if numlist is not a valid numlist.

Source code

Distributed with the elabel package.

Author

Daniel Klein

University of Kassel

klein.daniel.81@gmail.com

Also see

Online: mata

if installed: elabel