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: bysort variable measuring continuous increase in panel variable
From
Nickolas Lyell <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: bysort variable measuring continuous increase in panel variable
Date
Wed, 21 Aug 2013 15:51:52 -0400
Hi,
I'm trying to generate a variable that identifies when a county did not have a recession, by indicating when there was continual economic growth.
In a sense, I want:
bysort fips_num: noRecession = 1 if GDP[2013] > GDP[2012]
continued over a set period of years so it returns 1 only if the growth was continuous over a set period of years (say 2002 - 2013).
Fips_num is my id for groups of observations, with the panel encompassing the years 1990-2013.
Is a for loop the best way to accomplish this?
Thank you much,
---
Nicholas Lyell
*
* 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/