Hi,
for a given panel dataset with embedded information about the time
dimension structure I want to obtain the periodicity in the time
direction; for example the value 4 if the data are quarterly (for
several cross units, of course, because we're in a panel). I know that
the $pd accessor doesn't work here because in a panel context it gives
me the total length of the time dimension (as documented).
I'm wondering whether there is a better (shorter) way than the following
hansl function and test cases:
<hansl>
function scalar pd_paneltime(void)
catch pd = nelem(seasonals())
if $error
return 1 # assume the case of non-seasonal data
# (but could also be simply no panel-time info)
else
return pd
endif
end function
# artificial example
nulldata 20
setobs 5 1:1 --stacked-time-series
setobs 4 1900:1 --panel-time # quarterly
eval pd_paneltime() # gives 4
# real example
open grunfeld # annual
eval pd_paneltime() # gives 1
</hansl>
thanks for any hints
Sven