Am 06.07.2012 11:10, schrieb Jan Tille:
Hello I am a new gretl user and have a question whether and how it
is
possible to run a loop only via a selection of time series that have
minimum length of 24 months. The series's have different start and
end dates and I want to run a regression for each series that has a
minimum of 24 data points. Is there anybody, who can hint me on how
to restrict or define the loop properly. On possibility is, to
preselect the data that I import into gretl but this would be
tedious, because I will also run a different model on all series that
have a minimum of 12 data point.
Thanks in advance,
Jan
Hi Jan,
one easy way would be to check the observation numbers used in each
regression by looking at the value of the accessor variable $T, like so:
<hansl>
ols y const x
if $T>=24
# do stuff
else
# discard the results
endif
</hansl>
If running the redundant regressions is too costly computationally
(which I very much doubt given the small number of observations
involved), you could check the sample properties based on the given
variable (y) before doing anything:
<hansl>
smpl --no-missing y
if $nobs>= 24
ols y const x
# do stuff
else
# do not do anything
endif
</hansl>
HTH,
sven