Help for makeid

Description

makeid creates a unique ID for every observation in the dataset. These IDs are coded and nested, based on strata-type variables which uniquely identify the observations.

For example, given a variable list such as country state district name, a unique ID is returned for every observation such that:

1. Country code in the ID is fully unique

2. State code in the ID is unique within country

3. District code in the ID is unique within country and state

4. Each name has a unique ID within country, state, and district.

makeid prefixes each ID with the first letter of the project name, as a best practice to prevent against automatic conversion to numbers (in Excel for example).

Syntax

makeid varlist , generate(newvarname) project(Project Name)

Demo

sysuse auto.dta , clear

makeid foreign make , gen(uniqueid) project(Demo)

isid uniqueid , sort

list foreign make uniqueid in 1/5

list foreign make uniqueid in 53/57

Author

Benjamin Daniels
bbdaniels@gmail.com

Contributing

makeid is open for development on GitHub.
Submit bugs and feature requests here.
If you like makeid, be sure to visit my homepage
and Stata boilerplate code.