@month but for weekly?
Posted: Tue Oct 08, 2024 2:10 pm
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?
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?