"v2 is the moving sum of v1."
Not exactly, Moving SUM includes the current value. PMA stands for Prior Moving Average so what you have would probably be called a Prior Moving Sum.
Anyhow Try:
IF ($CASENUM GE 3)
PMS_3=
SUM(Lag(v1,1)*3,
Lag(V1,2)*2,
Lag(V1,3)*1
).
HTH, David
David Marso wrote
Please consult the documentation for the LAG function.
--
DEBOER wrote
Hi guys!
Im using create function and PMA to calculate a moving sum.
create v2=PMA(v1,3).
compute v2=v2*3.
v2 is the moving sum of v1.
I want to weight v1 in v3 how can I do so?
ex
v1 v2 v3
1
2
3
4 6 (1*1+2*2+3*3)=8
5 9 (2*1+3*2+4*3)=20
6 12 (3*1+4*2+5*3)=26
7 15 and so on
8 18
9 21
v3 is a moving weigtning of v1 for that last 3 cases
Thanks in advance
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"