Hi,

I have an hourly dataset which I want to transform (compact) to daily data. I'm going to describe some problems, first using the GUI, then with a concrete script example (but different problems).

GUI:

I applied the dataset structure wizard from Data / Reduce frequency with what seemed to be a success at first, by choosing "to 7-day daily" and averaging as the compaction method. However, it then turned out that the data compaction didn't seem to be correct. Notice that the dataset starts not at midnight, but in the middle of the first day, so during the first day there are less than 24 obs; maybe that matters. Specifically, I created a "check" series that only holds 1 during the hours of the first day. I would expect that that first day in the daily data then gets a 1, but instead it got a 0. There also seemed to be other artefacts afterwards.

Script example:

<hansl>

nulldata 100
setobs 24 10:4    --time-series # hourly,  starts at day 10, hour 4
series day = $obsmajor
series hour = $obsminor
series check = day==10 ? 1 : 0 # is 1 for less than 24 hours

dataset compact 7 # error, not supported
</hansl>

First, it's funny that the compaction "worked" in the GUI, but the script reaction is that it's not supported. But maybe the latter is more appropriate, given my problems before. Next, if instead of "dataset compact 7" I use "dataset compact 1", there's no error, but gretl now thinks it's an annual dataset, but my "check" variable still doesn't get the 1 value for the first compacted obs.

thanks

sven
_______________________________________________
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/

Reply via email to