On Fri, 18 Mar 2022, Sven Schreiber wrote:
Am 16.03.2022 um 18:38 schrieb Sven Schreiber:
>
>
> obs: 792, days in sample: 806
>
> missing day-rows: 14
>
> Gretl gets the sample span right and also automatically reverses the
> data ordering. Fine! However, how do I find out which were the missing
> days? It's a lot of data, and a time series plot doesn't show any gaps.
> BTW, this is 7-day-daily. I also tried to use the missing() function,
> but that doesn't give me anything different from zero.
OK, here's a workaround that I've found:
series d2 = 1 != diff(epochday($obsmajor,$obsminor,$obsmicro))
Then the series d2 holds 1 (ones) in those places where missing days are
in-between. If you want you can also apply the zeromiss() function on
top to get rid of the zeros, depending on your needs.
I wouldn't call this a workaround. In fact, it can be easily generalised
to gappy daily dataset with fewer than 7 days a week. Here's an example
with a 5-day-per week dataset:
<hansl>
clear
open dbnomics
data EIA/PET/RBRTE.D --name=brent
wd = weekday($obsmajor,$obsminor,$obsmicro)
dd = diff(epochday($obsmajor,$obsminor,$obsmicro))
gap = wd == 1 ? dd > 3 : dd > 1
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------