The solutions posted seem excessively cumbersome.
. set obs 30
obs was 0, now 30
. g year=_n+1969
. g quin=int((_n-1)/5)
. tab quin,gen(dquin)
Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
On Nov 11, 2005, at 2:33 AM, Lynda wrote:
I have a variable Year:
...
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
...
How do I create one dummy variable for each 5-year interval with one
command.
Typically I can get it manually by generating one dummy at a time
gen year1=1 if year>=1991 & year<=1995
...
*
* 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/