Hi,
I am trying to create a weekly series (with 52 observations) where each week's obs is the median of the same week during the past 20 years.
I can do it in monthly as below:
for !i=1 to 12
series s1{!i}=@recode(@month={!i},s1,na) 'create 12 parallel series dropping all values but a specific month, for all years
next
for !i= 1 to 12
series output=@recode(@month={!i},@median(s1{!i}), output)
next
Is there anything similar (or any other suggestions) for weekly?
@month but for weekly?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13403
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @month but for weekly?
I am in a weekly workfile.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13403
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @month but for weekly?
Code: Select all
'monthly
series output_m = @mediansby(s1, @month)
'weekly
series output_w = @mediansby(s1, @datepart(@date, "ww"))
(in answer to your question, since weeks aren't really defined in any frequency other than weekly, the @datepart(@date, "ww") function represents "@week")
Follow us on Twitter @IHSEViews
Re: @month but for weekly?
Never used @mediansby before.
Thank you. Very helpful!
Thank you. Very helpful!
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest