Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Collapsing dataset


From   [email protected]
To   [email protected]
Subject   Re: st: Collapsing dataset
Date   Wed, 20 Jul 2005 13:49:58 -0400

A not-so-elegant solution involves the use of -tag- and -collapse-, for example:

egen tag = tag(date var1)

keep if tag


Hope this helps,
Clint



On 20 Jul 2005 at 13:36, kelly johnson wrote:

> Hi,
> 
> Suppost I have data like this:
> 
> 
> Date		Var1
> 07/24/2002	10
> 07/24/2002	10
> 07/24/2002	10
> 07/24/2002	10
> 07/24/2002	10
> 07/24/2002	10
> 07/24/2002	10
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/25/2002	12
> 07/26/2002	14
> 07/25/2002	14
> 07/25/2002	14
> 07/25/2002	14
> 07/25/2002	14
> 
> How do i get a data set like this:
> 
> Date	Var1
> 
> 07/24/05  10
> 07/25/05  12
> 07/26/05  14
> 
> Thanks!
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> *
> *   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