Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Count observations within timeframe


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Count observations within timeframe
Date   Thu, 14 Apr 2011 17:57:40 +0100

A similar question was asked and answered quite recently

http://www.stata.com/statalist/archive/2011-03/msg01030.html

Nick

On Thu, Apr 14, 2011 at 5:50 PM, Michael Hecker <Hecker.Michael@gmx.de> wrote:

> I have a dataset with M&A transactions and I want to create a variable that
> holds the number of successfull transactions during the last 100 days.
> The relevant variables should be: announcement date, completion date and
> status (widthdrawn/completed/pending).
>
> One solution is to use two loops (one that runs over all transactions and
> one the goes from the current transaction backwards until it finds a
> transaction with completion date more than 100 days ago),
> but I suppose there must be a more efficient solution. Maybe something with
> egen and count
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index