*! v13.0 5May2015 RM

Title

findunique -- Unique Identifiers Finder

Syntax

findunique
varlist [if] [in]
[, options]

options

sorting Sorts data according to the most concise rule (i.e. according to the most parsimonious unique identifier set of variables)

first Displays only the most parsimonious unique identifier set of variables

ssc Installs the two components needed to run findunique (see remarks below)

Description

findunique displays combinations of unique identifiers in a dataset.

This command allows the user to find a rule according to which each
single observation in a dataset is uniquely identifiable.
findunique displays all the possible sets of variables among those specified in varlist whose
combined values uniquely identify observations and shows them in order from
the most parsimonious to the set with the largest number of variables.

Remarks

findunique requires two components: tuples (authors: Joseph N. Luchman and Nicholas J. Cox) and unique (authors: Michael Hills and Tony Brady). Find below useful links on the two components.

. findit tuples

. findit unique

. ssc install tuples

. ssc install unique

Example

Load 1998 data on cross-country life expectancy.

. sysuse lifeexp

What are the set of variables that uniquely identify observations?

. findunique lexp

. findunique lexp popgrowth

. findunique lexp popgrowth country

. findunique *

. findunique *, first

Clearly, since this dataset is a cross-country snapshot at a fixed point in time, the most parsimonious set of unique identifiers includes only one variable: country. We can now sort data according to our preferred unique identifier.

. findunique *, sort first

Author

Riccardo Marchingiglio

riccardo.marchingiglio@kellogg.northwestern.edu