I'm running EV-8.
I have country-year panels. Data were imported (stacked) from stata.
Observations for one variable "Z" were recorded from two sources because each source covered different years for different countries. There are two dummy variables to indicate source - "dum1" and "dum2" For example:
country year Z dum1 dum2
3 2003 24.60 0 0
3 2004 23.50 0 0
3 2005 25.80 0 0
3 2006 24.20 0 0
3 2007 22.70 0 0
3 2008 24.70 0 1
3 2009 24.00 0 0
3 2010 24.90 0 1
3 2011 25.20 0 1
4 1995 39.80 0 0
4 1996 37.00 0 0
4 1997 36.10 0 0
4 1998 35.40 0 0
4 1999 36.10 0 0
4 2000 38.90 0 0
4 2001 38.50 0 0
4 2002 39.30 0 0
4 2003 40.20 0 0
4 2004 38.30 0 0
4 2005 36.10 0 0
4 2006 33.10 0 1
4 2007 33.40 0 1
4 2008 30.90 0 1
4 2009 31.40 0 1
4 2010 31.30 0 1
I used smpl @all if dum1=1 and retained 212 observations (Z was NA for some country-year combinations)
I unstacked the data for panel estimation & estimated a panel model. The estimation used 246 observations.
Apparently, the smpl was not inherited by the reshaped data.
Is it possible to sample by both cross-section and non-sequential observation? If so, how?
Thanks,
--Larry
panel sample selection
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: panel sample selection
I don't understand the question.Is it possible to sample by both cross-section and non-sequential observation? If so, how?
-
Raffalovich
- Posts: 7
- Joined: Wed Feb 01, 2012 12:16 pm
Re: panel sample selection
I want to use only those values of Z that came from source indexed by dum1.
I can select only those observations with smpl in the stacked data by using 'if dum1=1" but this sample selection is not inherited in the unstacked data.
Can I select, in the unstacked data, only those observations of Z from source indexed by dum1=1?
Thanks,
--Larry
I can select only those observations with smpl in the stacked data by using 'if dum1=1" but this sample selection is not inherited in the unstacked data.
Can I select, in the unstacked data, only those observations of Z from source indexed by dum1=1?
Thanks,
--Larry
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
panel sample selection
Just set the sample in the unstacked page...
-
Raffalovich
- Posts: 7
- Joined: Wed Feb 01, 2012 12:16 pm
Re: panel sample selection
Setting the sample in the unstacked page results in either NO selection, or in too few observations to work with.
In the unstacked data, variables are indexed by cross-section.
So I have to select by cross-section. I can use operators "OR" or "AND".
Using "OR": "If dum1_1 =1 or dun1_2=1 or dum1_3=1 ...." has no effect because different years are selected for different countries. If the criterion is true for ANY country-year, that observation is selected for ALL countries.
Using "AND" selects only those observations where the condition is true for ALL countries. This results in too few observations to work with.
In the unstacked data, variables are indexed by cross-section.
So I have to select by cross-section. I can use operators "OR" or "AND".
Using "OR": "If dum1_1 =1 or dun1_2=1 or dum1_3=1 ...." has no effect because different years are selected for different countries. If the criterion is true for ANY country-year, that observation is selected for ALL countries.
Using "AND" selects only those observations where the condition is true for ALL countries. This results in too few observations to work with.
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: panel sample selection
Something is unclear here. The variable dum1, etc., is just a set of zeros and ones for each observation. The values don't change when the workfile is unstacked.
-
Raffalovich
- Posts: 7
- Joined: Wed Feb 01, 2012 12:16 pm
Re: panel sample selection
I've attached the first 4 panels of the unstacked data. There is one column for each cross-section.
- Attachments
-
- tab3.pdf
- (25.14 KiB) Downloaded 351 times
Who is online
Users browsing this forum: No registered users and 2 guests
