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
Fixed effects model dummys left out due to collinearityHello everyone, Currently I am trying to regress a sample of approximately 1600 funds over 131 (mon…
Excluding 5% of smallest observations for subgroup with panel dataHello, I have panel data for a sample of European banks. However, the sample is not really represen…
svy: mean and svy: reg give different results - why?Hello, I have a simple case of survey data and am puzzled why svy: mean, over gives me different res…
Structural breaksHi, I am performing the Johansen cointegration test in Stata16. Before going to the test I have perf…
scatter line plotHow do I create a scatter connected graph between three groups and simultaneously add a mean with st…
Subscribe to:
Post Comments (Atom)
0 Response to dummy=1 over a period when a condition satisfies
Post a Comment