Hello,
How would I define a sample command which uses the last possible observations only if there is not an NA, please?
In the screenshot attached I would like to define the sample as:
smpl 15/03/2021 15/03/2021 (as all the values are available)
and then tomorrow
smpl 16/03/2021 16/03/2021
Thanks a lot.
Best,
Günter
Sample command
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Sample command
a) no screenshot.
b) NA based on what? A series? A group? All series in the workfile?
b) NA based on what? A series? A group? All series in the workfile?
Follow us on Twitter @IHSEViews
Re: Sample command
Hi Gareth,
Forgot the attachments, sorry.
The NAs concern the group "g_g10_pch" in the attached workfile.
For 16/03/2021 there are NA so I would like to move the sample to the previous day if possible via a command.
Thanks a lot.
Best,
Günter
Forgot the attachments, sorry.
The NAs concern the group "g_g10_pch" in the attached workfile.
For 16/03/2021 there are NA so I would like to move the sample to the previous day if possible via a command.
Thanks a lot.
Best,
Günter
- Attachments
-
- movers_shakers_spx_sectors_d.wf1
- (1.03 MiB) Downloaded 138 times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Sample command
If you want to exclude dates where there are any NAs:
If you just want the last one excluded, it is a little more work:
Code: Select all
smpl if @robs(g_G10_pch)=g_g10_pch.@count
If you just want the last one excluded, it is a little more work:
Code: Select all
series fullobs = @recode(@robs(g_G10_pch)=g_g10_pch.@count, 1, na)
%last = fullobs.@last
smpl @first {%last}
Follow us on Twitter @IHSEViews
Re: Sample command
Perfect. Thanks a lot. Best, Günter
Who is online
Users browsing this forum: No registered users and 21 guests