Page 1 of 1

Group series without NAs after TRAMO-SEATS

Posted: Fri Jul 03, 2020 5:59 am
by ww_jones
Hi,

I am dealing with the following issue: I have a big number of different time series and I want to run seasonal adjustment using TRAMO-SEATS. I want my code to seasonally adjust all series, however some of them apparently do not need SA and the TS output is just a string of NAs. I want my code to select and group all series that undergo TRAMO-SEATS (i.e. output is real, no NAs) plus all the rest that do need seasonal adjustment.

To illustrate it better - say I have series:

s1, s2, s3

I run TRAMO-SEATS, I have the following output:

s1_sa (x,x,x...), s2_sa (y,y,y...), s3_sa (NA, NA, NA)

I would like my code to group s1_sa, s2_sa and s3 (not s3_sa, since it gives NAs)

Is there an elegant way to do this? Thank you in advance!

Re: Group series without NAs after TRAMO-SEATS

Posted: Fri Jul 03, 2020 8:27 am
by EViews Gareth

Code: Select all

group non_nas for %j s1 s2 s3 if @obs({%j}_sa) > 0 then non_nas.add {%j}_sa endif next

Re: Group series without NAs after TRAMO-SEATS

Posted: Sun Jul 05, 2020 8:15 am
by ww_jones
Thanks!

Actually I wanted to put all the SA series and the original ones that do not need SA into one group. So I did the following - I run these twice, once for the SAs and once for the NAs and grouped them all together in the end:

Code: Select all

group non_nas for !i=1 to non_sa.@count 'non_sa is the folder where all the original series were %j = non_sa.@seriesname(!i) if @obs({%j}_sa) > 0 then non_nas.add {%j}_sa endif next group nas for !i=1 to non_sa.@count %j = non_sa.@seriesname(!i) if @obs({%j}_sa) = 0 then nas.add {%j} endif next group all non_nas nas 'grouping them all
Maybe there's a more elegant way, but it worked fine, so thanks again!