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: Treating similar events in adjacent years in panel set as one
From
"Brinkerink Jasper (OS)" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Treating similar events in adjacent years in panel set as one
Date
Thu, 12 Dec 2013 14:53:33 +0100
Dear Statalist users,
I just started using Stata. I have browsed through the archives of Statalist, but couldn't find an answer to my question:
I am working on a panel data set containing investment data for individual companies in various industries over 9 years. I have constructed a dummy variable X that takes value 1 if variable U in a certain year takes a value above a certain threshold α. This variable X denotes the event of interest in my study and will later on be used as the independent variable in my regressions. An example of my panel set thus looks like the following:
Id year U X(α=1.5)
-----------------------------------
1 1 1.4 0
1 2 0.8 0
1 3 1.7 1
1 4 1.1 0
1 5 0.7 0
1 6 1.8 1
1 7 1.3 0
1 8 1.2 0
1 9 0.9 0
-----------------------------------
2 1 1.1 0
2 2 1.2 0
2 3 1.8 1
2 4 1.9 1
2 5 1.3 0
2 6 1.4 0
2 7 1.6 1
2 8 1.2 0
2 9 1.4 0
-----------------------------------
In running the regressions I want to classify adjacent events (so two or more consecutive '1' values of X) as one event, rather than multiple events. Consider for example the data above: For company 1, two events took place in the 9 years, in year 3 and in year 6. Company 2 has 3 '1' values for U. However, I want to treat the two 1's in year 3 and 4 as the same unique event, rather than 2 seperate events for theoretical reasons. How could I implement this efficiently in Stata?
Thanks for any consideration,
Jasper Brinkerink
p.s. It might be important to note that I am using Stata 12 in a secured remote access setting, in which I have no control over the software. Furthermore, it is impossible to import external files into this setting, making it impossible to use external macros for example. Therefore, only solutions using internal Stata 12 syntax will be applicable.
*
* 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/