Page 1 of 1

loop through series in a panel

Posted: Wed Sep 09, 2020 7:43 am
by dsdsdsdsd
hello ...

I am very new with eViews ...

I have setup a panel workfile ... from 1980-2020 ... with 37 observations (countries) ...

so I imported an excel sheet (datasrc_countries) with the list of 37 countries (the list of 37 does not match up with the workfile size = 40x37) ...

now I want to properly assign to each stack within the workfile series COUNTRY, the appropriate country name which comes from the imported series DATASRC_COUNTRY ...

my plan is to iterate through the list of 37, and then apply a @recode based on CROSSID ... I need a way to pull each item from the DATASRC_COUNTRY series ... I tried
@elem( datasrc_country , @Str( !j ) )
and thus get an error: Date does not uniquely define observation in panels in .... I understand that the @elem does not work for panel data.

in the eviews.com/help, I do not see a panel-related function to pull elements out ..

- any thoughts?

- thanks, Shannon

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 7:57 am
by EViews Gareth
Perhaps you could describe (or even better, provide the files) the situation a bit better. I'm struggling to see exactly what you're trying to do.

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 8:34 am
by dsdsdsdsd
in the group window on the right you can see the top "stack", from "1 - 80" to "1 - 19" ... ofcourse that is part of a repeating pattern: "1 - 80" to "1 - 20" ... "37 - 80" to "37 - 20" ...

my intent is to:

Code: Select all

COUNTRY=@recode( CROSSID=!j , datasrc_country{ @Str( !j ) } , "foobar" ) 'inside a for loop

such that in the 1-stack I should have COUNTRY => "AUSTRALIA", and the 2-stack I should have COUNTRY => "AUSTRIA", etc ...
screenshot_eviews.png
screenshot_eviews.png (272.04 KiB) Viewed 9545 times

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 9:31 am
by EViews Gareth
Bring the country names into a new page, not the panel page.
Then copy the names over from that new page to the panel, using general match merge.

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 9:52 am
by dsdsdsdsd
ok... I will try that, but may I ask, please, is it possible to do it as I was attempting? I suppose this is really a question of: is it possible to iterate down a column in a panel?

- thanks ... I will update when I get the multi page effort to work ...

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 10:44 am
by dsdsdsdsd
I am using copy to match merge ... but the src page does not have an id ... I looked under properties and options, but I couldn't find anything ... is there a default id name?

Code: Select all

copy(options) wf_src::pg_src\datasrc_country wf_dest::pg_dest\country ??? crossid
screenshot_eviews_2.png
screenshot_eviews_2.png (273.81 KiB) Viewed 9532 times

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 11:09 am
by EViews Gareth
Create one.

Code: Select all

series myid = @trend+1

Re: loop through series in a panel

Posted: Wed Sep 09, 2020 5:07 pm
by dsdsdsdsd
that worked ...

thanks