Panel Data

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

Moderators: EViews Gareth, EViews Moderator

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Panel Data

Postby mjuk2015 » Sun Sep 10, 2017 2:24 am

Hi,

I would appreciate some input on how best to deal with panel data.

I have in total about 100 indices (60 quarters each) which I import into Eviews from excel. I then stack the data into a different sheet and the indices are identified by a small text string.

The reason for my work is to see the relative movement of the indices compared to the main index. I therefore would like to create dummys for each index first and then estimate dlog(Panel)= C +dlog(mainindex) + dlog(mainindex)*dummys

What would be the easyiest way to first create the dummys and then estimate various permutations?

Many thanks

Mark

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 7:50 am

I have been playing around with the FOR LOOP function but can't get it to work.

My cross sections are identified in a var01 string series. Essentially I need to run:

series 1, 2, 3...x = @recode(var01="1,2,3,.....x", 1, 0)

to create dummy series for each cross section. Gareth could you give some pointers please?

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

Re: Panel Data

Postby EViews Gareth » Thu Sep 14, 2017 7:59 am

Probably best off using a pool, which can estimate with cross-section specific regressors.
Follow us on Twitter @IHSEViews

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 8:06 am

Thanks Gareth

The panel structure works fine, I have done it on a smaller scale. I just don't want to have to manually run the @RECODE command to make each dummy. I have to run several other sized panel in the same way.

Surely FOR LOOP can be used in someway?

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

Re: Panel Data

Postby EViews Gareth » Thu Sep 14, 2017 8:21 am

group g @expand(var01)
Follow us on Twitter @IHSEViews

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 8:39 am

Thanks but I'm not sure how to use a group for what I need.

Could you please just briefly run through how the loop function works with string series identifiers? I am sure this is very efficient once you know how to use but there is not much guidance apart from the few threads you have written on here. There is very little on youtube etc compared to stata SAS R etc.

Thanks

Mark

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

Re: Panel Data

Postby EViews Gareth » Thu Sep 14, 2017 8:41 am

Follow us on Twitter @IHSEViews

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 9:35 am

Thanks Gareth

I have looked at this before.

This is what I have tried instead of @recode, which gives the error "Syntax error in "If VAR01="{%x}"" I can't seem to sample the individual cross sections to change the dummy to 1. Any suggestions would be greatly received!

Code: Select all

 for %x OFFICE INDUSTRIAL RETAIL

series D_{%x} = 0
 
if var01="{%x}"
smpl @all
endif

series D_{%x} = 1
smpl @all

next

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

Re: Panel Data

Postby EViews Gareth » Thu Sep 14, 2017 9:46 am

Code: Select all

if var01=%x
Follow us on Twitter @IHSEViews

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 9:51 am

Nope still "Syntax error in "if var01="OFFICE""

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

Re: Panel Data

Postby EViews Gareth » Thu Sep 14, 2017 9:52 am

You're missing a "then".
Follow us on Twitter @IHSEViews

mjuk2015
Posts: 7
Joined: Sat Sep 09, 2017 5:43 am

Re: Panel Data

Postby mjuk2015 » Thu Sep 14, 2017 10:26 am

Well spotted. The code runs now but just has all obs = 1 so I am not sure if the if statement is sampling correctly.

EDIT: Working fine now, thanks again.


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 6 guests