How to enter data into a panel workfile.

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

MJJ
Posts: 4
Joined: Sun Jun 01, 2014 8:40 am

Re: How to enter data into a panel workfile.

Postby MJJ » Sun Jun 01, 2014 11:00 pm

Thank you Gareth for your fast reply.

Since I'm newbie, and to confirm with you, I save your code into a prg file and run it from file>Run>Run Program without any arguments.
Eviews successfully imported data.

One last thing, later on I need to add maybe 3 to 4 extra variables to the existing variables. So, can I add them to the excel file and run the same code you've just sent me to import them too?
Attachments
data.jpg
data.jpg (114.58 KiB) Viewed 20853 times
1.prg
(1.12 KiB) Downloaded 542 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Mon Jun 02, 2014 5:29 am

Yep
Follow us on Twitter @IHSEViews

rgj_23
Posts: 2
Joined: Mon Jun 23, 2014 9:54 am

Re: How to enter data into a panel workfile.

Postby rgj_23 » Wed Jun 25, 2014 7:16 am

Dear Gareth,

I am using EViews 8. I am currently having problems with importing my data (attached) as a panel into EViews. The problem is that some of the cross-sectional data is micro-economic data identifiable with Country_code and bank_number attributes (shown on tab "Panel Data1_Bank-specific var") and some of the cross-sectional data is of macro-economic nature, which is identifiable only with Country_code (shown on tab "Panel Data2_Country specific va").
EViews Forum Question.xlsx
Raw data
(139.57 KiB) Downloaded 589 times


To sum up, the data consists of following cross sections for years 2004-2011 for 9 countries:
Bank-specific variables: ASSETS, EXCAP, FUND_COST, LOANS_ASSETS, NPL_RESERVES, ROE
Country-specific variables: DEPINS, GDPGR, LERNERINDEX, LERNERINDEXSQ, COUNTRY_DUMMY
I would also like to include a dummy variable for years. I would like to apply Arellano & Bond's GMM estimator to the data.

I read up on the ways of importing different kinds of panel data as described on Page 1 of this forum, but the problem is that the EViews import (attached) is not recognised as a panel since I am not able to access the dynamic panel wizard.
bankscope_250 dataset_25.06.2014_eviews forum.WF1
Eviews import
(872.84 KiB) Downloaded 524 times

The precise excel format which was uploaded into the EViews file is attached here:
Panel dataset uploaded into EViews.xlsx
Data uploaded into EViews
(147.93 KiB) Downloaded 572 times


Another question about dummy variables in my data - I manually created the COUNTRY_DUMMY and TIME_DUMMY variables since it was not too much work. How do I get EViews to recognise these as dummy variables? Alternatively, would you advice generating these variables directly in EViews somehow?

Since I am under great time pressure to finish my dissertation, I would really appreciate a quick reply from your side.

Many thanks in advance and kind regards,
Rachita
Last edited by rgj_23 on Wed Jun 25, 2014 7:53 am, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Wed Jun 25, 2014 7:48 am

You have entered the data correctly. You have a three dimensional panel. Most estimation techniques, including DPD, are not available in 3D panels.
Follow us on Twitter @IHSEViews

rgj_23
Posts: 2
Joined: Mon Jun 23, 2014 9:54 am

Re: How to enter data into a panel workfile.

Postby rgj_23 » Wed Jun 25, 2014 7:59 am

EViews Gareth wrote:You have entered the data correctly. You have a three dimensional panel. Most estimation techniques, including DPD, are not available in 3D panels.


Dear Gareth,

Thanks very much for your super-quick reply.

Is there any possible work-around to convert the panel into a 2-dimentional panel (E.g. somehow summarise the bank data into country data) so that it becomes possible to use the dynamic panel wizard?

Kind regards,

Rachita

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Wed Jun 25, 2014 8:04 am

That's a question for you - I can't possibly say whether it is econometrically valid for your model to sum all the banks in a country, etc...
Follow us on Twitter @IHSEViews

sammy66
Posts: 2
Joined: Wed Jul 30, 2014 12:20 am

Re: How to enter data into a panel workfile.

Postby sammy66 » Wed Jul 30, 2014 12:45 am

Is there a way to replicate the first method of creating a panel workfile using code, rather than going through the menus interactively? I can successfully convert from pooled data to stacked data using the first method described above, but I'd like to have some code to be able to quickly repeat the process.
__________________
daily deals, online shopping sites, hot deals, best deals
Last edited by sammy66 on Tue Aug 05, 2014 1:22 am, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Wed Jul 30, 2014 8:14 am

The first example has the code version at the bottom.
Follow us on Twitter @IHSEViews

samiha
Posts: 3
Joined: Tue Aug 26, 2014 11:51 am

problem with data input and panel regression

Postby samiha » Mon Sep 08, 2014 12:34 pm

hey i am trying to input panel data into eviews 8. I read the instructions and did as was mentioned, I imported data from a stacked horizontal dataset from my excel file. However in eviews, i am not getting a dateid series as is shown in the example. I imported the data, then went to proc>structure/resize current page and then did everything as mentioned then hit ok...in the examples shown in this forum, I am supposed to get a series in my eviews workfile named "dateid". But i did not get any such series (no extra series at all). I need to run a panel regression with return of 202 firms and three other variables; Current, past ans next year PE ratio, and profitability. I have still run the regression, by estimating with this formula:
Abnormal Return=α+β (PE)+β1(PE(-1))+β2(PE(+1))+ β3(Profitability)+ε

Even though I still got an output by running the regression...i still am not sure if my data was properly considered as panel data with the 202 company names as cross sections for the different variables; Abnormal Return, Pe ratio and Profitability. I have attached the excel file from where i imported stacked data into eviews. The variables Abnormal Return, PE ratio and Profitability are all time series data. Why did I not get a date id series? Is it a problem if no such series were generated by eviews?
Attachments
Book1.xlsx
(126.17 KiB) Downloaded 502 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Mon Sep 08, 2014 12:57 pm

You don't need to do anything special to get that as a panel. Just open that file up in EViews (8), and it will automatically detect it as a panel. At least it did for me.
Follow us on Twitter @IHSEViews

Unzy00
Posts: 1
Joined: Sun Feb 08, 2015 4:59 am

Re: How to enter data into a panel workfile.

Postby Unzy00 » Mon Feb 09, 2015 3:38 am

Hi, I am using your program (below) to enter data into a panel workfile from excel. Can it be modified to loop through a pre-defined number of excel sheets and ignor all others? Example: in my excel file the first 3 sheets are the cross-section identifiers (Milan, Rome, Naples) then the 4th sheet is raw data download from a database (DATA); I would like Eviews to ignor this 4th sheet - is that possible?

%filename = "c:\temp\sheetpanel.xlsx" 'file name of the file to be opened

%sheetnames = @tablenames(%filename) 'find the names of the sheets in that file

%sheetname = @word(%sheetnames,1) 'get the first sheet name

wfopen(wf=panel) %filename range=%sheetname 'open the first sheet as a new workfile (with name=panel, and pagename=the first sheet name)

alpha crossid = %sheetname 'create a cross-section identifier series, and set it equal to the sheetname

'loop through the remaining sheets, loading them into the workfile one at a time
for !i=2 to @wcount(%sheetnames)
%sheetname = @word(%sheetnames,!i) 'get the name of the next sheet
import %filename range=%sheetname @append @genr crossid=%sheetname 'append the next sheet to the bottom of our workfile
next

pagestruct @date(year) crossid 'structure the page as a panel, by stating that the series "YEAR" is a date id and the series "CROSSID" is a cross-section identifier.

agaro123
Posts: 10
Joined: Mon Feb 09, 2015 10:10 am

Re: How to enter data into a panel workfile.

Postby agaro123 » Mon Feb 09, 2015 12:14 pm

Hi Gareth,

I've tried to open this but I keep failing. I need to run a gravity model and you directed a past user to here, I've gone through all pages in this thread but I still can't get it right. I'm using Eviews7 by the way.
Attachments
Book1.xlsx
(331.31 KiB) Downloaded 432 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Mon Feb 09, 2015 12:51 pm

Unzy00 wrote:Hi, I am using your program (below) to enter data into a panel workfile from excel. Can it be modified to loop through a pre-defined number of excel sheets and ignor all others? Example: in my excel file the first 3 sheets are the cross-section identifiers (Milan, Rome, Naples) then the 4th sheet is raw data download from a database (DATA); I would like Eviews to ignor this 4th sheet - is that possible?

%filename = "c:\temp\sheetpanel.xlsx" 'file name of the file to be opened

%sheetnames = @tablenames(%filename) 'find the names of the sheets in that file

%sheetname = @word(%sheetnames,1) 'get the first sheet name

wfopen(wf=panel) %filename range=%sheetname 'open the first sheet as a new workfile (with name=panel, and pagename=the first sheet name)

alpha crossid = %sheetname 'create a cross-section identifier series, and set it equal to the sheetname

'loop through the remaining sheets, loading them into the workfile one at a time
for !i=2 to @wcount(%sheetnames)
%sheetname = @word(%sheetnames,!i) 'get the name of the next sheet
import %filename range=%sheetname @append @genr crossid=%sheetname 'append the next sheet to the bottom of our workfile
next

pagestruct @date(year) crossid 'structure the page as a panel, by stating that the series "YEAR" is a date id and the series "CROSSID" is a cross-section identifier.



Change this line:

Code: Select all

%sheetnames = @tablenames(%filename)   'find the names of the sheets in that file

to just list the sheets you want to import.

Code: Select all

%sheetnames = "sheet1 sheet2 sheet4 sheet6"
Follow us on Twitter @IHSEViews

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Mon Feb 09, 2015 12:54 pm

agaro123 wrote:Hi Gareth,

I've tried to open this but I keep failing. I need to run a gravity model and you directed a past user to here, I've gone through all pages in this thread but I still can't get it right. I'm using Eviews7 by the way.


What are the identifiers of your panel? Which columns uniquely identify each observation?
Follow us on Twitter @IHSEViews

agaro123
Posts: 10
Joined: Mon Feb 09, 2015 10:10 am

Re: How to enter data into a panel workfile.

Postby agaro123 » Wed Feb 11, 2015 1:17 am

I don't have that, i was looking at cross-sections between different host and source countries. I uploaded the file here for you to take a look if you can. How should I add that so I get past the pesky error at the beginning about unique source id ?

later edit: I managed to open the data in eviews but i get an "illegal panel structure" error.
Attachments
Book1.xlsx
(331.31 KiB) Downloaded 410 times


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 19 guests