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

Bas
Posts: 1
Joined: Mon Oct 28, 2013 11:55 am

Re: How to enter data into a panel workfile.

Postby Bas » Tue Oct 29, 2013 3:57 am

Dear Gareth,

Given your expertise i hope you can help me with a problem i'm encountering.

I am new to Eviews and im trying to import a panel data set from excel to Eviews following your detailed steps. In excel I already stacked the data as a panel structure which Eviews should automatically recognize. The problem I have is with the irregular date intervals my observations. I am looking at some variables to explain the cost of index funds. I have 80 index funds which i track over the period of 2000 to 2012. The problem that i have is that for some index funds i have 12 years of data (the full 2000 to 2012) but some funds came into existence later (say 2006) and i only have data over 2006 - 2012. When I only use the funds with the full 12 years of data, eviews correctly recognizes it as a dated panel with the fund and date as identifiers. however, If I include all the funds Eviews doesn't recognize this automatically anymore and I do not fully understand how i can overcome this issue. I hope you can help me. Attached you will find the workfile that I'm using.

Thank you in advance for your time.

Regards,
Attachments
try_2.xlsx
(162.38 KiB) Downloaded 1102 times

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Tue Oct 29, 2013 8:08 am

If I open that up in EViews 8, and accept the default settings (i.e. just hit "Finish"), EViews appears to recognise the panel structure just fine.

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: How to enter data into a panel workfile.

Postby tvonbrasch » Wed Nov 06, 2013 3:09 am

Hi,

In your example on importing panel data from an excel file (byyear.xls), the country code were in all cells of the excel file. However, when downloading data from OECD, the countries appear only merged in one cell across all years. See the example byyear1.xls. how do i import this file without manually making changes to excel?

Sincerely
Thomas von Brasch
Attachments
byyear1.xls
(26.5 KiB) Downloaded 1368 times

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: How to enter data into a panel workfile.

Postby tvonbrasch » Wed Nov 06, 2013 6:21 am

I found a nice code for Excel that does the job, but it would be nice to also know how to do it in Eviews.

EXCEL: Unmerge cells and fill with duplicate data with VBA code

With the following VBA code, you can quickly unmerge the cells and fill down the values.
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
Option Explicit
Sub Test()
Dim r As Excel.Range
Dim r1 As Excel.Range
Dim myR As Excel.Range
For Each r In ActiveSheet.UsedRange
Debug.Print r.Address, r.Count
If r.MergeArea.Count > 1 Then
Set myR = r.MergeArea
r.UnMerge
For Each r1 In myR
r1.Value2 = myR.Value2
Next r1
End If
Next r
End Sub
3. Then press the F5 key to run this code, the merged cells have been unmerged and auto-filled down the original merged values.

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Wed Nov 06, 2013 9:00 am

In that particular example, it is pretty easy to just bring it in using default settings, then modify the country series to fill in the blanks:

Code: Select all

country = @recode(country="", country(-1), country)

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: How to enter data into a panel workfile.

Postby tvonbrasch » Thu Nov 07, 2013 1:38 am

Thanks!

Sincerely
Thomas von Brasch

yiulun
Posts: 1
Joined: Fri Nov 22, 2013 2:39 pm

Re: How to enter data into a panel workfile.

Postby yiulun » Fri Nov 22, 2013 2:48 pm

Dear group

How can i enter this data into a panel workfile??????
Attachments
EviewFile_BOARD.xls
(37 KiB) Downloaded 1024 times

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Sat Nov 23, 2013 11:49 am

That is not panel data.

Heuschnupfen
Posts: 3
Joined: Fri Dec 06, 2013 6:21 am

Re: How to enter data into a panel workfile.

Postby Heuschnupfen » Fri Dec 06, 2013 6:36 am

Dear Eviews Community,

unfortunatel I have to ask for your help. I am working with bilateral Data (Country pairs and the change of indicators over time - e.g. GDP ). Everything works fine so far with the Tutorial of Eviews Gereth (thanks a lot so far!) but I have a problem with one workfile.

Strategy so far: Organizing data in excel to have it "ready-to-import" - attached at the end
Importing foreign data as workfile; restructering the individual workfile to a panel -> Copy the Observations to one Workfile.

Equation: Log(stocks) = c log(realgdp) log(realgdp_partner) log(distw);
I already used in Excel the same identifieres to make it easier.

Stocks = FDI Stocks between the countries
Distw = weighed distance between the countries, no change over time.

Problem: With the stocks: Proc->reshape->stack in new page -> Identifieres year?
After that: d series01
rename year stocks
rename var01 year
Then: Proc-> restructured -> Dated Panel with Cross Section Ids (geo partner) ; Date series: Year
After that I see that is should be a Panel (Range!) but eviews does not give me any Panel Options under the Quick->Estimation-> LS

That Procedures works with all the workfiles where there is no "Partner" Identifier. Did I mess up sth. with the Identification?
Thanks a lot in advance for any suggestions, I would appreciate any help!
Have a nice weekend.

Ps: Files Attached: Excel File and Workfile, basic and restructered
Attachments
fdi Stocks.wf1
(199.77 KiB) Downloaded 1108 times
FDI flows and stocks bereinigt-simuliert-importfähig.xls
(150.5 KiB) Downloaded 1202 times

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Fri Dec 06, 2013 9:12 am

You have a three dimensional panel. EViews doesn't offer specialised panel estimation options when dealing with three dimensional panels.

Heuschnupfen
Posts: 3
Joined: Fri Dec 06, 2013 6:21 am

Re: How to enter data into a panel workfile.

Postby Heuschnupfen » Fri Dec 06, 2013 9:26 am

Thanks a lot for the fast reply!

Do I have any possibility to apply (time) fixed Effects? Or do I have to change the excel files (merging geo and partner)?
Do you recommend a special procedure?

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Fri Dec 06, 2013 9:30 am

If you just want fixed effects, you can create the dummy variables manually.

Heuschnupfen
Posts: 3
Joined: Fri Dec 06, 2013 6:21 am

Re: How to enter data into a panel workfile.

Postby Heuschnupfen » Fri Dec 06, 2013 2:04 pm

Well, then I will have to do that.

Thanks a lot, Chef!

Last question, but I think that can figure that out by myself.
Easiest way will be with the @expand command, is that correct?

In my case @expand(geo, @drop(AT)) @expand(year, @drop(1997)) for fixed (Time) Effect, isn't it?
Anyways, appreciate your advise, you helped my already a lot.
Cheers.

Second Edit: Little Research helped, here to help others who are searching the same prob:

http://forums.eviews.com/viewtopic.php?t=3840&f=4

Cciobu89
Posts: 4
Joined: Fri Feb 28, 2014 10:06 am

Re: How to enter data into a panel workfile.

Postby Cciobu89 » Fri Feb 28, 2014 10:39 am

Hi,

I am currently trying arrange a panel data, but all the time I am trying to unstack my data I receive this message from Eviews: ID doesn't uniquely identify workfile observations.

I use variables as unstacking identifiers and observation identifiers: country and var01



Could you please advise why this is happening?
Attachments
EViews.xlsx
(8.54 KiB) Downloaded 930 times

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

Re: How to enter data into a panel workfile.

Postby EViews Gareth » Fri Feb 28, 2014 11:02 am

That Excel file appears to be empty.


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 0 guests