On Thu, 2 Sep 2010, Riccardo (Jack) Lucchetti wrote:
On Thu, 2 Sep 2010, Allin Cottrell wrote:
> On Thu, 2 Sep 2010, Henrique Andrade wrote:
>
>> How can I accumulate a series in 12 months inside a script? Now this is what
>> I'm doing:
>>
>> series var112m = var1 + var1(-1) + var1(-2) + var1(-3) + var1(-4) + var1(-5)
>> + var1(-6) + var1(-7) + var1(-8) + var1(-9) + var1(-10) + var1(-11)
>>
>> Could you please suggest a more elegant way?
# alternative 1
y1 = filter(x, ones(12,1))
That wins the elegance prize, hands down!
Allin