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!
Group series without NAs after TRAMO-SEATS
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13317
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Group series without NAs after TRAMO-SEATS
Code: Select all
group non_nas
for %j s1 s2 s3
if @obs({%j}_sa) > 0 then
non_nas.add {%j}_sa
endif
next
Follow us on Twitter @IHSEViews
Re: Group series without NAs after TRAMO-SEATS
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:
Maybe there's a more elegant way, but it worked fine, so thanks again!
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!
Who is online
Users browsing this forum: No registered users and 38 guests