Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Count observations within timeframe

From   Michael Hecker <>
Subject   st: Count observations within timeframe
Date   Thu, 14 Apr 2011 18:50:25 +0200

Hello everybody,
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

Thanks in advance,

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index