Panel data: sample selection, cross section and period

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

mfb
Posts: 28
Joined: Sun Apr 14, 2013 8:16 am

Panel data: sample selection, cross section and period

Postby mfb » Mon May 27, 2013 6:27 am

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

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Panel data: sample selection, cross section and period

Postby EViews Glenn » Tue May 28, 2013 9:32 am

Use a sample condition with an "IF" for the cross-sections.

mfb
Posts: 28
Joined: Sun Apr 14, 2013 8:16 am

Re: Panel data: sample selection, cross section and period

Postby mfb » Sat Jul 27, 2013 5:03 pm

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

Postby EViews Gareth » Sat Jul 27, 2013 5:34 pm

It was moved.

mfb
Posts: 28
Joined: Sun Apr 14, 2013 8:16 am

Re: Panel data: sample selection, cross section and period

Postby mfb » Sat Jul 27, 2013 5:56 pm

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.

YK_Econ
Posts: 36
Joined: Wed Jan 28, 2015 8:34 am

Re: Panel data: sample selection, cross section and period

Postby YK_Econ » Tue Nov 17, 2015 9:21 am

I would have have the exact same question and just can't find an answer. Is there somewhere an answer?

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

Postby EViews Gareth » Tue Nov 17, 2015 10:27 am

Other than the answer given in this thread?

YK_Econ
Posts: 36
Joined: Wed Jan 28, 2015 8:34 am

Re: Panel data: sample selection, cross section and period

Postby YK_Econ » Wed Nov 18, 2015 5:52 am

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

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

Postby EViews Gareth » Wed Nov 18, 2015 7:10 am

Use an if condition.

YK_Econ
Posts: 36
Joined: Wed Jan 28, 2015 8:34 am

Re: Panel data: sample selection, cross section and period

Postby YK_Econ » Wed Nov 18, 2015 12:38 pm

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

Code: Select all

if @crossid=aut bel dnk equation uncon_beta.ls dlog(ypc) log(ypc) c
and follow up question:

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
btw. i do not have a sheet with single countries. just the panel sheet.

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

Postby EViews Gareth » Wed Nov 18, 2015 12:50 pm

Code: Select all

smpl if country="aut" or country="bel" or country="dnk"
or you can use @inlist

You can use @meansby

YK_Econ
Posts: 36
Joined: Wed Jan 28, 2015 8:34 am

Re: Panel data: sample selection, cross section and period

Postby YK_Econ » Wed Nov 18, 2015 1:20 pm

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

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

Postby EViews Gareth » Wed Nov 18, 2015 2:00 pm

Did you use the @meansby function?

YK_Econ
Posts: 36
Joined: Wed Jan 28, 2015 8:34 am

Re: Panel data: sample selection, cross section and period

Postby YK_Econ » Thu Nov 19, 2015 8:53 am

i use the @meansby function (but by following the clicking instructions of the eviews help)

is there a code for it?

Code: Select all

series gdp_average = @meansby(gdp).@crossid
something like this?

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Panel data: sample selection, cross section and period

Postby EViews Glenn » Thu Nov 19, 2015 12:25 pm

Code: Select all

series gdp_average = @meansby(gdp, @crossid)


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests