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

st: grouping by time window


From   "Andre pierre" <[email protected]>
To   [email protected]
Subject   st: grouping by time window
Date   Mon, 13 Jun 2005 11:21:06 +0200

Hi every body,

I would like to create groups of observations with at least 2 products invented within 365 days (not a civil year), by firm and industry code.

obs; Firm; ic; date
1; 1; A; 31 dec 02
2; 1; A; 2 Apr 03
3; 1; A; 12 dec 03
4; 1; A; 5 jan 04
5; 1; A; 4 may 04
6; 1; B; 4 may 04
7; 2; A; 1 jan 01
.
.
.


In this example, observations 1 to 3 and 4 to 5 would correspond to a "group", as the products are invented by the same firm, in the same industry code within 365 days. The groups have to be "successive", and not "overlapping".
Thanks for your help,
Andr�

_________________________________________________________________
MSN Search : des r�ponses � tous vos besoins ! http://www.imagine-msn.com/hotmail/default.aspx?locale=fr-FR

*
* 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