How to find out the common sample of series ?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
How to find out the common sample of series ?
How to find out programmaticaly the common sample of series ?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
How to find out the common sample of series ?
What does the "common sample of a series" mean?
Re: How to find out the common sample of series ?
The common sample of series in a workfile. For instance, in our workfile we have :
- Serie S1 which contains non-missing values from 1990Q1 to 2010Q2
- Serie S2 which contains non-missing values from 1998Q1 to 2010Q2
- Serie S3 which contains non-missing values from 2000Q1 to 2011Q4
The common sample would be in that case the period where all those 3 series have non-missing values : 2000Q1 to 2010Q2
Then we would like to find out how to identify the common sample like when you use groups to generates statistics for the group with the option to select common sample.
- Serie S1 which contains non-missing values from 1990Q1 to 2010Q2
- Serie S2 which contains non-missing values from 1998Q1 to 2010Q2
- Serie S3 which contains non-missing values from 2000Q1 to 2011Q4
The common sample would be in that case the period where all those 3 series have non-missing values : 2000Q1 to 2010Q2
Then we would like to find out how to identify the common sample like when you use groups to generates statistics for the group with the option to select common sample.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to find out the common sample of series ?
To steal a line from Gareth,
Code: Select all
smpl if s1<>na and s2<>na and s3<>na-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to find out the common sample of series ?
I guess it depends on what you plan to do with that information. The basic information can be got by by putting them into a group (say G) and doing the following:
which will create a dummy variable, called common, containing a 1 if that observation is available for all series in the group, and a zero other wise.
If you just want to set the sample you can do:
Getting actual dates is considerably more complicated if there are internal NAs. If there are no internal NAs, then you can get the start date and end date with:
Code: Select all
series common = @robs(G)=G.@count
If you just want to set the sample you can do:
Code: Select all
smpl if @robs(G) = G.@count
Code: Select all
smpl if @robs(G) = G.@count
series common = 1
smpl @all
string start = @otod(@ifirst(common))
string end = @otod(@ilast(common))
Re: How to find out the common sample of series ?
Hi,
Thanks all for this information. I am a bit puzzled however as to how to use the "start" and "end" strings within a smpl command. All of the following returned an "Error in sample. Illegal date" message. My workfile uses annual data by the way.
smpl start @last
smpl @val(start) @last
smpl @year(start) @last
smpl @dateval(start, "yyyy") @last
smpl @year(@val(start)) @last
Any help would be greatly appreciated.
Thanks all for this information. I am a bit puzzled however as to how to use the "start" and "end" strings within a smpl command. All of the following returned an "Error in sample. Illegal date" message. My workfile uses annual data by the way.
smpl start @last
smpl @val(start) @last
smpl @year(start) @last
smpl @dateval(start, "yyyy") @last
smpl @year(@val(start)) @last
Any help would be greatly appreciated.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to find out the common sample of series ?
Code: Select all
smpl {start} @last
Who is online
Users browsing this forum: No registered users and 2 guests
