Hi everybody,
using EVIEWS 14. Question: How do you define a sample in panel data set so that the sample comprises all cross sections with no NAs in the selected date range?
See example in the files attached: If the selected data range is 2001 - 2010 only crossids 1 and 2 should be in the sample. With years 2000 - 2009 selected as date range, only crossids 1 and 3 should be in the sample. And if the selected date range is 2001 - 2009, all three crossids 1, 2 and 3 should be in the sample.
In the example which has only a small data set, this can be accomplished manually. However, with a large panel data set containing a large number of cross sections, a command or small program would be needed.
Best, mamo
Panel data: Sample comprising all cross sections with no NAs in the selected date range
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Panel data: Sample comprising all cross sections with no NAs in the selected date range
- Attachments
-
- exampledata.wf1
- (13.21 KiB) Downloaded 631 times
-
- exampledata.png (15.68 KiB) Viewed 194747 times
Re: Panel data: Sample comprising all cross sections with no NAs in the selected date range
Okay, I managed to find an approach that works:
Code: Select all
smpl 2001 2010 if @nasby(x, @crossid)=0 ' only crossids 1 and 3 are in the sample
smpl 2000 2009 if @nasby(x, @crossid)=0 ' only crossids 1 and 2 are in the sample
smpl 2001 2009 if @nasby(x, @crossid)=0 ' crossids 1, 2, and 3 are in the sample
Who is online
Users browsing this forum: No registered users and 0 guests
