[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: eliminating unique values

From   "Eva Poen" <[email protected]>
To   [email protected]
Subject   Re: st: eliminating unique values
Date   Fri, 2 May 2008 10:19:10 +0100

008/5/2 Stefano  Costalli <[email protected]>:
> Dear statalisters,
>  I have a variable with about 25.000 observations and many unique values. I need to drop the unique values, but I can't browse the whole data set to search for each unique value individually.

I'm not quite I understand. Do you have one variable X in your data,
and within X there are some duplicates, and you want to drop
everything that is unique? In this case you can either use

duplicates tag X, gen(tag)
drop if tag==0

or, equivalently,
bysort X: gen drop = _N
drop if drop==1

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index