Bookmark and Share

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


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

st: generating event windows from event dates


From   Bülent Köksal <bkoksal@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: generating event windows from event dates
Date   Mon, 21 May 2012 14:55:27 +0300

Dear Stata Users

I have a dummy variable that equals one for certain event dates. How
can I generate a new indicator variable that is equal to one for event
windows like (-2,2)?

For example,

I have t and eventdate below and would like to generate eventwindow.
Thanks in advance for any help.


t	eventdate	eventwindow
1	0	0
2	0	0
3	0	1
4	0	1
5	1	1
6	0	1
7	0	1
8	0	0
9	0	0
.
.
.
16	0	0
17	0	0
18	0	1
19	0	1
20	1	1
21	0	1
22	0	1
23	0	0
24	0	0



--
Bülent Köksal

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index