[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: analogue of NODUPKEY
At 11:05 PM 12/29/2003 -0500, firstname.lastname@example.org wrote:
Does the duplicates drop command do what you want? e.g.
I am looking for a Stata analogue of a SAS procedure for a certain type of
duplicate removal. Suppose a dataset has fields A-J. For all subsets of
records for which fields A-C are identical, I wish to keep only the first
record and discard the rest, keeping all fields of the retained records.
What is the simplest way to do this with Stata commands?
duplicates drop a b c, force
From the online help:
"duplicates drop drops all but the first occurrence of each group of
duplicated observations... force specifies that observations duplicated
with respect to a named varlist are to be dropped. The force option is
required whenever such a varlist is given, as a reminder that information
may be lost by dropping observations, given that those observations may
differ on any of the variables not included in varlist."
* For searches and help try: