That's not a precise criterion so far as I can see. Suppose market growth has always been positive. Do you want the calculation to be based on the last 4, 5, 6, ... years?
-
Login or Register
- Log in with
webuse grunfeld gen growth = D.invest tsegen min_4_prev_growth = rowmin(L(0/3).growth)
investmentdate | stake | industry_id | pe_id | year |
1995-8 | 0 | 49 | 944 | 1995 |
1995-1-1 | 0 | 67 | 1543 | 1995 |
1995-9 | 8.4 | 89 | 1541 | 1995 |
1995-10-1 | 0 | 181 | 1543 | 1995 |
1995-10-19 | 30 | 187 | 1040 | 1995 |
1995-6 | 0 | 198 | 1444 | 1995 |
1995-6 | 0 | 198 | 1339 | 1995 |
1996-1-18 | 0 | 25 | 1543 | 1996 |
1996-10 | 0 | 102 | 1444 | 1996 |
1996 | 18.9 | 148 | 1490 | 1996 |
1996-9-1 | 36.7 | 153 | 1543 | 1996 |
1996-12 | 0 | 187 | 1040 | 1996 |
1997 | 0 | 93 | 1541 | 1997 |
tsegen x_sd_10 = rowsd(L(1/4).x F(1/5).x), by(id)
rangestat (sd) x_sd_10 = x, by(id) interval(time -4 5)
tsegen `x'_sd10 = rowsd(L(0/4).`x' F(1/5).`x', 10) rangestat (sd) `x'_sd_10_bis = `x', by(id) interval(t -4 5)
Comment