Am 07.11.2013 19:26, schrieb antonio.puca(a)enel.com:
Hello Gretl communuty,
i’m writing for an easy question (I hope). I need to standardize a daily
time series based on a monthlly mean and standard deviation (not global
mean and standard deviation, this is the main problem). I’ve tried with
matrix but I’m not able to convert a matrix, which is made with an
aggregate function (based on monthly mean and stddev), in a variable in
my TS with almost 300 obs.
Conceptually easy but probably a bit fiddly, I'd say. I would suggest to
create series for the year and month numbers:
series year = $obsmajor
series month = $obsminor
and then have an outer loop for the years (loop y=y1..y2) and an inner
loop for the months (loop m=m1..m2), and inside this nested loop
restrict the sample:
smpl year==y --restrict
smpl month==m --restrict
Then calculate your standardization only for this restricted sample.
hth,
sven