Command Reference : Function Reference : Function Reference: D
  
 
@dupsid
Duplicate group identifier.
Identifier for the duplicate group assigned to the observation.
Syntax: @dupsid(x1,[x2, x3, ... ], [s])
x: series, alpha, group, vector, matrix
x#: series, alpha, group, vector, matrix
s: (optional) sample string or object when the x are series, alpha, and groups and assigning to series
Return: series, vector
For series, alpha, and groups, a duplicate is defined as two observations having identical values for all of variables given by the arguments.
For vectors and matrix objects, a duplicate is defined as two row identifiers having identical values in each of the vector and matrix objects given by the arguments.
Once sets of duplicates are identified, the observations or rows within each set are all assigned a group identifier ranging from 1 to n, where n is the number of groups with common values.
Examples
Let X be a series of length 10 that alternates between 0 and 1. Then
show @dupsid(x)
will display a series whose observations alternate between the group numbers 1 and 2 (observations whose value in X is 0 belong to group 1, observations whose value in X is 1 belong to group 2).
Let MAT be a matrix whose rows correspond to different observations. Then
vector dids = @dupsid(mat)
returns a (column) vector of group IDs.
Cross-references
See @dupselem and @dupsobs.
See also @uniquevals.