Panel data: sample selection, cross section and period
Moderators: EViews Gareth, EViews Moderator
Panel data: sample selection, cross section and period
When working with panel data, how can I select from the whole sample just a few cross sections and a few periods?
I tried to use the Quick/Estimate Equation/Estimation Settings/Sample box but, apparently it only allows selection of periods, not of periods and cross sections simultaneously.
Thanks
I tried to use the Quick/Estimate Equation/Estimation Settings/Sample box but, apparently it only allows selection of periods, not of periods and cross sections simultaneously.
Thanks
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Panel data: sample selection, cross section and period
Use a sample condition with an "IF" for the cross-sections.
Re: Panel data: sample selection, cross section and period
Thanks for your reply. However, I noticed you had replied only today, 27-July-2013. Reason for this is that your answer is in Technical Support/Estimation whereas I had posted my query in Econometric Discussions. I was expecting an answer in Econometric Discussions, not in Estimation. Actually, I had been sort of taken aback as my query had disappeared from Econometric Discussions. I found your answer in Estimation by struck of luck. How did my query get moved from Econometric Discussions to Estimation?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data: sample selection, cross section and period
I can well realize that now. Problem is I didn't know that happened.
Last edited by mfb on Sat Jul 27, 2013 5:58 pm, edited 1 time in total.
Re: Panel data: sample selection, cross section and period
I would have have the exact same question and just can't find an answer. Is there somewhere an answer?
Best
YK
Best
YK
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data: sample selection, cross section and period
Other than the answer given in this thread?
Re: Panel data: sample selection, cross section and period
at first, i cannot find this option in the estimation window.
secondly, in the sample window, it doesnt work to just put the country code ("aus" is not defined)
thirdly, there must be a simple code to choose certain countries (= cross sections). i havent figured that one out.
best
YK
secondly, in the sample window, it doesnt work to just put the country code ("aus" is not defined)
thirdly, there must be a simple code to choose certain countries (= cross sections). i havent figured that one out.
best
YK
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data: sample selection, cross section and period
Use an if condition.
Re: Panel data: sample selection, cross section and period
unfortunately, I am not even aware of the basics. the @crossid doesn't want to work.
how does it look like, if i want to run the regression
equation uncon_beta.ls dlog(ypc) log(ypc) c
for 28 eu countries (aut, bel, etc.)
is it
and follow up question:
i also would like to create a series with the averages of gdp from each country like
btw. i do not have a sheet with single countries. just the panel sheet.
best
YK
how does it look like, if i want to run the regression
equation uncon_beta.ls dlog(ypc) log(ypc) c
for 28 eu countries (aut, bel, etc.)
is it
Code: Select all
if @crossid=aut bel dnk
equation uncon_beta.ls dlog(ypc) log(ypc) c i also would like to create a series with the averages of gdp from each country like
Code: Select all
series average_gdp = @mean(gdp 'here i need to tell him: from each crossid best
YK
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data: sample selection, cross section and period
Code: Select all
smpl if country="aut" or country="bel" or country="dnk"
You can use @meansby
Re: Panel data: sample selection, cross section and period
the @meansby doesnt work. it gives me a weird list, where in the @crossid column, there are means I dont understand like [0,50] and [50,100]. these are definily not the means i am looking for.
isn't there a quick code for it?
best
YK
isn't there a quick code for it?
best
YK
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel data: sample selection, cross section and period
Did you use the @meansby function?
Re: Panel data: sample selection, cross section and period
i use the @meansby function (but by following the clicking instructions of the eviews help)
is there a code for it?
something like this?
is there a code for it?
Code: Select all
series gdp_average = @meansby(gdp).@crossid -
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Panel data: sample selection, cross section and period
Code: Select all
series gdp_average = @meansby(gdp, @crossid)
Who is online
Users browsing this forum: No registered users and 2 guests
