Hi,
I have one dataset saved in a dated panel with cross-section id structured as "XXX_YYY" (XXX-country code, YYY-industry code) over 1970-2010, and another dataset in a dated panel over 1960-2010 with cross-id "XXX". What I'm trying to do is copying the data in the second panel into the first one. The copied series would have the same data across industries but different across countries. I guess the challenge is to create a cross-id series in the second panel that also has the form XXX_YYY so that I can simply match-merge into the first one.
Is there a quick way of doing this? Any tip would be much appreciated.
Thanks,
Morak5
Copying data from one dated panel to another
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Copying data from one dated panel to another
Unless I'm missing something, couldn't you just generate an extra series in the first panel containing only the country code for each observation and then match merge in the series from the second panel using the new country series as the destination id series?
You should be able to use any series you want for matching ids if you select 'General Match Merge' criteria when copying the series.
To strip off the part of the identifier before the underscore, you could use an expression like:
alpha xxx = @left(a,@instr(xxx_yyy,"_")-1)
You should be able to use any series you want for matching ids if you select 'General Match Merge' criteria when copying the series.
To strip off the part of the identifier before the underscore, you could use an expression like:
alpha xxx = @left(a,@instr(xxx_yyy,"_")-1)
-
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Copying data from one dated panel to another
Make that:
alpha xxx = @left(xxx_yyy,@instr(xxx_yyy,"_")-1)
alpha xxx = @left(xxx_yyy,@instr(xxx_yyy,"_")-1)
Re: Copying data from one dated panel to another
It works perfectly! Many thanks, Chris.
Who is online
Users browsing this forum: No registered users and 29 guests