Eviews 7.1:
In order to seasonallyadjust properly, my samples are almost all all subsets of my workfile. Is there a way to get the first element of a sample, since @first gives me the @first element of the workfile, not of the sample?
@first and @last equivalents for smpl?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @first and @last equivalents for smpl?
What are you trying to achieve?
Re: @first and @last equivalents for smpl?
short answer: Categorization for processing
I have a dataset of stores, some of which I am inserting imputed values, some of which I am resetting samples. Some of these will contain more than 36 months of data (and can therefore be seasonally adjusted and trended) and others will fall short, and will then use the seasonal factors from an aggregate and/or average store.
while @obs, @nas and similar functions cant take a sample argument, I either have to know specifically the sample necessary for each store before resetting the sample, or it becomes an extremely nasty set of code to work off the bounds.
I use a recursive function which recalculates the sample based on the number of @nas left in the changing sample. I'm solving most of this currently by taking and building two table objects and effectively recalculating the offset based on the current sample. It is a kluge but it seems like my only option. Having better access to the startpoint and endpoint of a sample would eliminate the need for a lookup table which I am constantly updating.
I have a dataset of stores, some of which I am inserting imputed values, some of which I am resetting samples. Some of these will contain more than 36 months of data (and can therefore be seasonally adjusted and trended) and others will fall short, and will then use the seasonal factors from an aggregate and/or average store.
while @obs, @nas and similar functions cant take a sample argument, I either have to know specifically the sample necessary for each store before resetting the sample, or it becomes an extremely nasty set of code to work off the bounds.
I use a recursive function which recalculates the sample based on the number of @nas left in the changing sample. I'm solving most of this currently by taking and building two table objects and effectively recalculating the offset based on the current sample. It is a kluge but it seems like my only option. Having better access to the startpoint and endpoint of a sample would eliminate the need for a lookup table which I am constantly updating.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @first and @last equivalents for smpl?
Both @obs and @nas work off the current workfile sample, so you just change the workfile sample, then use them.
I'm afraid it still wasn't particularly clear to me what you were doing, so I'm not sure how I can offer more help than that. Could you provide more detail on what you want @first, @last for?
I'm afraid it still wasn't particularly clear to me what you were doing, so I'm not sure how I can offer more help than that. Could you provide more detail on what you want @first, @last for?
Re: @first and @last equivalents for smpl?
@obs and @nas provide results relative to the workfile, not relative to the sample.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: @first and @last equivalents for smpl?
All series in a workfile page have the same range. There is no series-specific sample.
Is your situation that you have a bunch of NAs at different places in some series than in others?
Is your situation that you have a bunch of NAs at different places in some series than in others?
Re: @first and @last equivalents for smpl?
If you want the date range of your samples you can always do something like this (in EV7.1 at least) for storing your sample starting and end points in string format
%smplrange=@pagesmpl
%smpl_first=@wleft(%smplrange,1)
%smpl_last=@wright(%smplrange,1)
I am not sure either whether this answers your question.
Regards,
Javier
%smplrange=@pagesmpl
%smpl_first=@wleft(%smplrange,1)
%smpl_last=@wright(%smplrange,1)
I am not sure either whether this answers your question.
Regards,
Javier
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @first and @last equivalents for smpl?
javiersan's solution only works for simple samples. Any samples with if conditions won't work.
Re: @first and @last equivalents for smpl?
In this case the simple solution will work as a subroutine. If I do find I need to handle conditional sampless I can use this as a foundation.
Thank you all for your replies.
(And yes, Starz -I am in the process of constructing 100+ system models each of which have different data holes. Each unique model is used to categorize the behavior, regional models are built, classification models are built, and then a complete model is then built. From this, each system is then rescored vs expected behavior.)
Thank you all for your replies.
(And yes, Starz -I am in the process of constructing 100+ system models each of which have different data holes. Each unique model is used to categorize the behavior, regional models are built, classification models are built, and then a complete model is then built. From this, each system is then rescored vs expected behavior.)
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: @first and @last equivalents for smpl?
Sounds like you have a solution that works. Just in case, remember that the observation pointed to by @first can very well be NA. (Of course, you may have already set the sample to avoid this.)
Who is online
Users browsing this forum: No registered users and 2 guests
