Page 1 of 1

Panel Data

Posted: Sun Sep 10, 2017 2:24 am
by mjuk2015
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

Re: Panel Data

Posted: Thu Sep 14, 2017 7:50 am
by mjuk2015
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?

Re: Panel Data

Posted: Thu Sep 14, 2017 7:59 am
by EViews Gareth
Probably best off using a pool, which can estimate with cross-section specific regressors.

Re: Panel Data

Posted: Thu Sep 14, 2017 8:06 am
by mjuk2015
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?

Re: Panel Data

Posted: Thu Sep 14, 2017 8:21 am
by EViews Gareth
group g @expand(var01)

Re: Panel Data

Posted: Thu Sep 14, 2017 8:39 am
by mjuk2015
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

Re: Panel Data

Posted: Thu Sep 14, 2017 8:41 am
by EViews Gareth

Re: Panel Data

Posted: Thu Sep 14, 2017 9:35 am
by mjuk2015
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

Re: Panel Data

Posted: Thu Sep 14, 2017 9:46 am
by EViews Gareth

Code: Select all

if var01=%x

Re: Panel Data

Posted: Thu Sep 14, 2017 9:51 am
by mjuk2015
Nope still "Syntax error in "if var01="OFFICE""

Re: Panel Data

Posted: Thu Sep 14, 2017 9:52 am
by EViews Gareth
You're missing a "then".

Re: Panel Data

Posted: Thu Sep 14, 2017 10:26 am
by mjuk2015
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.