Building a Panel Dataset in Eviews 7

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

yasir
Posts: 18
Joined: Tue Apr 24, 2012 4:30 am

Building a Panel Dataset in Eviews 7

Postby yasir » Tue Oct 30, 2012 9:20 am

Dear all,

1). I am a PhD student in China and we are working in the Econometrics field. In my work laboratory, we have Stata 12 installed and we all use this software. However, I am trying to pursuade my superiors to use Eviews instead, because I think Stata is very complicated to work with (remembering all the commands and everything...). However, I have to demonstrate building a panel dataset in Eviews to them. Attached with this post is a dataset which was created using Stata, by using commands such as insheet, fillin, reshape, sort, merge, gen, tab, etc... I wonder can we create such a dataset in Eviews as well? The tutorial provided in this forum regarding the method of "How to enter data into panel format" http://forums.eviews.com/viewtopic.php?f=7&t=74, is not enough because it only brings the Excel file into a panel format. What I am looking for is using Eviews for manipulating, organizing, creating new fields, matching data, etc without using Excel or other spreadsheat program. I dont know how to say it but lets suppose I have raw data exports, imports, gdp on 250 countries for 41 years (1970-2011). This raw data has some years missing for some countries, other have zero imports, and so on and so forth. Are there any special tools or commands for bring this raw datasheet into a refined panel dataset like the one attached.

2). How do you do a Pseudo Poisson Maximum Likelihood estimation in Eviews 7? In Stata, just type poisson (or xtpoisson) dependent variable independent variables ... and it calculates the result. How to do it in Eviews. I tried the Integar Count Data and then Poisson by there is an error stating " Dependent variable must be an integar at observation ....."

Thanks
Attachments
Dataset.jpg
Dataset.jpg (256.72 KiB) Viewed 13353 times

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

Re: Building a Panel Dataset in Eviews 7

Postby EViews Gareth » Tue Oct 30, 2012 1:09 pm

What format is your data currently in?

yasir
Posts: 18
Joined: Tue Apr 24, 2012 4:30 am

Re: Building a Panel Dataset in Eviews 7

Postby yasir » Wed Oct 31, 2012 3:09 am

In Excel format, with some data files in .xls, some in excel comma separated values.

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

Re: Building a Panel Dataset in Eviews 7

Postby EViews Gareth » Wed Oct 31, 2012 7:53 am

You can probably just open those files directly into EViews, then.

yasir
Posts: 18
Joined: Tue Apr 24, 2012 4:30 am

Re: Building a Panel Dataset in Eviews 7

Postby yasir » Sun Nov 04, 2012 6:18 am

Dear Gareth,
Sorry for replying late. I was busy with my research thats why couldn't post in time. I know that we can import many different types of file (.xls, .dta,
etc) into Eviews but my question was not this. Let me explain my question in detail using Stata, then probably you will understand and provide me advice on what I want
to ask.

Suppose I want to estimate a gravity model of trade for 200 countries for the time period 1980 - 2011. So I have a file in which I download data from
internet which has all the data in the format of Exporter, Importer, Year, Export. Alongwith trade data, I will also need data on GDP and Population. So I download
that also from internet and now I have three excel files, 1). Trade data. 2). GDPs of countries (in the format of Country, Year, GDP) and 3). Population of countries
(in the format of Country, Year, Population).

Now I import the trade file into Stata. Because of the fact that many countries have missing values in a number of years, so first I have to organize the data such that every country has pair with every other country and corresponding to the same time period (For example, Afghanistan has no reported data from year 1980 to 2000). A panel data must be in the format of n*n*t where n means the number of countries and t being the time period. So in perfect conditions, I must have a balance panel of 1280000 observations. But since alot of countries have missing values and have not reported trade figures, I apply the fillin command (fillin exporter importer year) in Stata to bring it into a balanced panel of 1280000 observations. This command makes n*n*t observations where every exporter country is paired with an
importer country for the time period. Now I perform another command which replaces the empty export field of countries with a zero representing missing values (replace exports=0 if exports==.).

This was the first part of the data manipulation. After that I would like to combine both the trade with GDP and Population such that every country corresponds to its specific GDP and Population. I take the GDP file, I save it twice, once for the gdp_exporter and the other for gdp_importer (because we have pairs of countries, exporter, importer). Then I sort the file using exporter and year. I repeat the same procedure for gdp_importer file. And then I merge these two file stepwise with the trade file by sorting the trade file also in exporter and year and using the command merge exporter year using gdp_exporter and gdp_importer. I do the same for the population file. The result is a balanced panel dataset (missing values converted to zeros) where every country has a pair with other country for 32 years and GDP and Population corresponding to the same country pair. Similarly, in this way, I can merge data files containing data about dummy variables.

Finally, I come to my question. All the above steps can be performed in Stata. I want to know, I all this possible in Eviews and if yes, how? Thanks and sorry for the long procedure.

Yasir

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

Re: Building a Panel Dataset in Eviews 7

Postby EViews Gareth » Sun Nov 04, 2012 1:58 pm

In general, I believe, this sort of operation is much more complicated in Stata than in EViews. It is probably the case that you can just open the first file in EViews, and then drag the other two on top of it, and EViews will figure out what to do. Note that EViews does not require a panel to be balanced.

Without seeing the files, it is hard to offer more advice than that.

yasir
Posts: 18
Joined: Tue Apr 24, 2012 4:30 am

Re: Building a Panel Dataset in Eviews 7

Postby yasir » Sun Nov 04, 2012 9:48 pm

Dear Gareth,
You are right. I opened the first file and then draged the other two and amazingly, Eviews automatically knew what to do. It asked whether to replace or merge the new data and thats it. Great. Its so easy. By the way I tried to upload the files but its size does not permit me to upload it. Its more than 36 MB.

Thanks

Yasir

Nazguliya
Posts: 1
Joined: Wed Apr 17, 2013 2:06 pm

Re: Building a Panel Dataset in Eviews 7

Postby Nazguliya » Wed Apr 17, 2013 2:21 pm

HI GUYS,

I am using gravity model to estimate RTAs effects on trade patterns. Data includes 9 countries (they trade among each other) for 12 years; number of cross sections is 72. (9x8) so it is dynamic panel data. I use GMM estimation, the problem is distance variable that is constant "across time" but not across country pairs. I cannot include distance variable as a dummy, but otherwise, it says that it is near singular matrix. what can I do? Your help is really needed....Help! :cry:

thank you all in advance! :)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests