It is tough to explain but i will try my best.
"Surge" is the dummy variable i created for capital flow surge episodes which lasts at least 2 quarters or more (so i removed single quarter episodes).
I want to count it as surge=1 only if during the period there is at least one episode of surge that goes above 2 std level ("surge_2sd=1").
So i would ideally count only those that are marked in yellow and replace the variable "surge" i.e. 2002q1-2002q4 to zero since there is no single episode during that period that goes above 2sd.
Could anyone help with the code?
Related Posts with dummy=1 over a period when a condition satisfies
Deflating Brent Crude Oil Prices ($US) with US CPII currently have Brent Crude Oil prices in US dollars. However, I'd like to deflate it with US CPI s…
Include labels after margins pwcompare matrixFirst time poster. Apologies for errors. I'm wondering if there's a way to grab the labels along wit…
Loop?I want to replicate this code up to stateid==32; from 1 to 32. How can I do this without typing it o…
Stata not storing my matrix in MataHi all, I am running the code of DLW (2012) with using Stata 15. The command is meant to generate a…
Help: Can't format xtline plotDear community, I'm having three simple issues with with an 'xtline' plot. My plot looks as follow…
Subscribe to:
Post Comments (Atom)
0 Response to dummy=1 over a period when a condition satisfies
Post a Comment