In Stata, how do I detect duplicate observations in a data set?
You can check for duplicate observations in Stata in the following ways:
- The
isidcommand can detect duplicate observations: . isid x1 x2 x3 - The
duplicatescommand can list and flag duplicate observations. Thelistsubcommand lists the duplicate observations: . duplicates list x1 x2 x3 - The
tagsubcommand and thegenerate()option flag duplicate observations by assigning1to duplicacy in the variableduple: . duplicates tag x1 x2 x3, generate(duple)
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
This is document aqea in domain all.
Last modified on May 04, 2011.
Last modified on May 04, 2011.







