|
命令帮助里面也写了
[D] duplicates -- Report, tag, or drop duplicate observations
(View complete PDF manual entry)
Syntax
Drop duplicates
duplicates drop [if] [in]
duplicates drop varlist [if] [in] , force
Description
duplicates reports, displays, lists, tags, or drops duplicate observations,
depending on the subcommand specified. Duplicates are observations with
identical values either on all variables if no varlist is specified or on a
specified varlist.
duplicates report produces a table showing observations that occur as one or
more copies and indicating how many observations are "surplus" in the sense
that they are the second (third, ...) copy of the first of each group of
duplicates.
duplicates tag generates a variable representing the number of duplicates for each observation. This will be 0 for all unique observations.
duplicates drop drops all but the first occurrence of each group of duplicated observations. The word drop may not be abbreviated.
Any observations that do not satisfy specified if and/or in conditions are
ignored when you use report, examples, list, or drop. The variable created
by tag will have missing values for such observations.
|