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: Dummies for before, during and after treatment years
From
micono tzinbunoc <[email protected]>
To
statalist <[email protected]>
Subject
st: Dummies for before, during and after treatment years
Date
Sun, 23 Mar 2014 22:46:21 +0000
I have a simple question with regards to creating dummies to identify
from 1 year before the treatment up to 1 year after the treatment.
The -1 year dummy that I am trying to create should indicate the year
before the treatments and it should equal 1 only in years 1991 and
1996.
0 year dummy should identify the year when the treatment begins and it
should be equal 1 only in years 1992 and 1997.
...
+1year dummy should identify the year after the treatment ends and it
should be equal to 1 only in years 1994 and 2005.
id year treated
1 1990 0
1 1991 0
1 1992 1
1 1993 1
1 1994 0
1 1995 0
1 1996 0
1 1997 1
1 1998 1
1 1999 1
1 2000 1
1 2001 1
1 2002 1
1 2003 1
1 2004 1
1 2005 0
1 2006 0
I tried searching for this in statalist but I couldn't honestly find
a correct search term that would give me a solid answer to this
problem. If you have any solution, advice or a link to earlier
discussion, I would greatly appreciate. Thanks very much in advance.
Best wishes,
Mehmet
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/