UNIQUEVALUES—Extracts an ordered set of unique values
Posted: Wed Jun 29, 2011 11:59 am
This procedure returns a vector of sorted unique values for an input series over an indicated range.
@UniqueValues(values=VECTOR,other options) series start end
Options
values=VECTOR of values found in the series [required]
smpl=dummy with 0's in entries to skip [not used]
The following shows it in use. The data set (from Greene's Econometric Analysis) is an unbalanced panel, with individuals indexed by the "ID" series. UniqueValues generates a sorted list of the individuals into the VECTOR named VID.
@UniqueValues(values=VECTOR,other options) series start end
Options
values=VECTOR of values found in the series [required]
smpl=dummy with 0's in entries to skip [not used]
The following shows it in use. The data set (from Greene's Econometric Analysis) is an unbalanced panel, with individuals indexed by the "ID" series. UniqueValues generates a sorted list of the individuals into the VECTOR named VID.
Code: Select all
open data rwm.txt
data(format=free,org=columns) 1 27326 id female year age hsat handdum $
handper hhninc hhkids educ married haupts reals fachhs abitur univ $
working bluec whitec self beamt docvis hospvis public addon
@uniquevalues(values=vid) id