On Mon, 11 Apr 2022, Sven Schreiber wrote:
Hi,
my seemingly simple problem is this: in a quarterly dataset I have a
series where valid values are only given for the respective first
quarters, something like this:
a NA NA NA b NA NA NA c ....
I want to repeat and copy those values (a,b,c...) over to the other
quarters of the respective years and fill the NAs with that. (So annual
values are simply distributed over the quarters by repitition.)
However, I'm struggling to get the tdisagg() function to do that. Yes, I
have read the corresponding chapter 9 of the guide.
tdisagg is not designed for that job (simple repetition), which can be
done via
y = ok(y) ? y : y(-1)
But note that if you want "proper" disaggregation, tdisagg will accept
a series of the form you describe, with NAs in all but the first
sub-period -- you don't have to do the repetition first.
Allin