Hi,
is there a way how to reference a separate time observations for a given time series in
gretl?
For example, if I wish to compute a "recession" dummy, i.e. an indicator with 1,
if in the two last periods there were negative growth rates and 0 otherwise?
E.g. let's have this time series called X (below is some data, with the obs. number
and growth rate)
Obs. no X ln(X)-ln(X(-1))
1 34296
2 30383 -0.121145488
3 28899 -0.050076249
4 27669 -0.04349434
5 26303 -0.050629652
6 26206 -0.003694609
7 26687 0.018188163
8 26424 -0.009903867
9 25458 -0.037242653
10 23749 -0.069489611
11 24709 0.039627125
12 25151 0.017730107
13 24431 -0.029044839
14 25740 0.052193384
15 26240 0.019238762
16 25999 -0.009226888
17 26420 0.016063223
18 25847 -0.021926759
19 25660 -0.007261181
20 24407 -0.050063383
21 25618 0.048425253
What command would generate the values of 1 for periods with two consequtive negative
values in series? I.e. I would get this series:
n/a
n/a
1
1
1
1
0
0
1
1
0
0
0
0
0
0
0
0
1
1
0
Thanks,
Vladimir