Greetings all--
I am struggling to generate a new variable that SEEMS like it should be easy
but has been driving me nuts.
I am working with data that looks like the following:
Country Year Democracy Score Rev?
1 1999 8 0
1 2000 8 1
1 2001 2 0
1 2002 2 0
1 2003 2 0
1 2004 2 0
2 1999 6 0
2 2000 6 0
2 2001 6 1
2 2002 9 0
2 2003 9 1
2 2004 2 0
What I am trying to do is find a way to generate a variable that will code
as "1" for before the first revolution, "0" during ANY revolution, and code
the sequence of the revolution. For example, I would want the data above to
look like this:
Country Year Democracy Score Rev? Code
1 1999 8 0 1
1 2000 8 1 0
1 2001 2 0 2
1 2002 2 0 2
1 2003 2 0 2
1 2004 2 0 2
2 1999 6 0 1
2 2000 6 0 1
2 2001 6 1 0
2 2002 9 0 2
2 2003 9 1 0
2 2004 2 0 3
The goal is to be able to compare the distributions for the democracy scores
before and after the various revolutions. Is there a simple way to do this?
*
* 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/