Statalist


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

Re: st: eliminating unique values


From   "Stefano Costalli" <[email protected]>
To   [email protected]
Subject   Re: st: eliminating unique values
Date   Fri, 02 May 2008 11:31:52 +0200

You understood perfectly what I meant. 
Thanks Eva, I was stuck on it.

Stefano

-----Original message-----
From: "Eva Poen" [email protected]
Date: Fri, 02 May 2008 10:19:10 +0200
To: [email protected]
Subject: Re: st: eliminating unique values

> 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
> 
> Eva
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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