Hi, I need to sample every 30th observation from a series starting from the last observation, this is if my last observation is on the 7/15/2020, then the 30th observation before that would be the 6/15/2020, and then 5/15/2020. I was trying to use dateadd but didnt work. I hope someone knows the answer.
Thanks
sample every 30th observation from a series
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
superjocker
- Posts: 27
- Joined: Mon Mar 30, 2020 5:45 pm
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample every 30th observation from a series
To be clear, you mean 7/15/2020, 6/15/2020 and 5/16/2020?
Oh, and what frequency is the workfile?
Oh, and what frequency is the workfile?
-
superjocker
- Posts: 27
- Joined: Mon Mar 30, 2020 5:45 pm
Re: sample every 30th observation from a series
my data is daily and have observations since 1989.
It doesnt matter if a month have 31 or 28 or 29, just need to substract 30 observations so yes 5/16/2020.
Thanks
It doesnt matter if a month have 31 or 28 or 29, just need to substract 30 observations so yes 5/16/2020.
Thanks
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample every 30th observation from a series
Code: Select all
smpl if @mod(@trend,30)=28
Code: Select all
show @mod(@trend,30)
-
superjocker
- Posts: 27
- Joined: Mon Mar 30, 2020 5:45 pm
Re: sample every 30th observation from a series
Thank you Gareth, it works perfectly.
Regards
Regards
Who is online
Users browsing this forum: No registered users and 2 guests
