I don't understand what's wrong ! I work on an annual data file with 20
observations spanning from 1971 to1990 and create a dummy variable by using " loop
for i=1971..1990 ". When looking at the printout, changes are reported for each
iterations but finally, displaying the dummy variable I see no change . I replace the loop
by "i=1..20" and it worked fine .
Moreover, the time series plot doesn't show the usual graph's left margin, the
thin fine-looking space between Y-axis and the drawing (see attached).
Best,
Artur
---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez
des connaissances, des opinions et des expériences des internautes sur Yahoo!
Questions/Réponses.
gretl version 1.6.2.1
Current session: 2007/05/08 16:29
? genr sd_resid = sd(residuals)
Generated scalar sd_resid (ID 7) = 2,92443
? genr mark = (abs(residuals) > sd_resid)
Generated series mark (ID 8)
? genr series mark_bis
? loop for i=1971..1990
if abs(residuals[i]) > sd_resid
mark_bis[i] = 1
endif
endloop
loop: i = 1971
loop: i = 1972
loop: i = 1973
loop: i = 1974
mark_bis[i] = 1
loop: i = 1975
mark_bis[i] = 1
loop: i = 1976
loop: i = 1977
loop: i = 1978
loop: i = 1979
loop: i = 1980
loop: i = 1981
mark_bis[i] = 1
loop: i = 1982
loop: i = 1983
mark_bis[i] = 1
loop: i = 1984
loop: i = 1985
loop: i = 1986
loop: i = 1987
loop: i = 1988
loop: i = 1989
loop: i = 1990
mark_bis[i] = 1
Number of iterations: 20
? genr series mark_tris
? loop i=1..20
if abs(residuals[i]) > sd_resid
mark_tris[i] = 1
endif
endloop
loop: i = 1
loop: i = 2
loop: i = 3
loop: i = 4
mark_tris[i] = 1
loop: i = 5
mark_tris[i] = 1
loop: i = 6
loop: i = 7
loop: i = 8
loop: i = 9
loop: i = 10
loop: i = 11
mark_tris[i] = 1
loop: i = 12
loop: i = 13
mark_tris[i] = 1
loop: i = 14
loop: i = 15
loop: i = 16
loop: i = 17
loop: i = 18
loop: i = 19
loop: i = 20
mark_tris[i] = 1
Number of iterations: 20
? print residuals mark mark_bis mark_tris --byobs
Obs residuals mark mark_bis mark_tris
1971 1,197218 0 0 0
1972 2,670174 0 0 0
1973 -2,562178 0 0 0
1974 -5,389217 1 0 1
1975 -5,645469 1 0 1
1976 -2,006633 0 0 0
1977 0,363064 0 0 0
1978 1,540767 0 0 0
1979 0,016240 0 0 0
1980 -0,476465 0 0 0
1981 -3,045875 1 0 1
1982 -0,177509 0 0 0
1983 4,908354 1 0 1
1984 0,756328 0 0 0
1985 2,681048 0 0 0
1986 1,158102 0 0 0
1987 0,791340 0 0 0
1988 -2,879183 0 0 0
1989 0,851209 0 0 0
1990 5,248683 1 0 1