Copy values from cross-section to entire vector

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Copy values from cross-section to entire vector

Postby stefanp » Fri Jun 01, 2018 3:55 am

I use a panel data set. I need to copy some value from cross-section AA to another cross-section AB, but not to any other cross-sections.

So far, I create an auxiliary series TEMP, copy the value from AA to TEMP. However, when I want to copy TEMP to AB it does not work as for the corresponding sample (AB), the series TEMP contains only NAs.

EViews Glenn
EViews Developer
Posts: 2671
Joined: Wed Oct 15, 2008 9:17 am

Re: Copy values from cross-section to entire vector

Postby EViews Glenn » Fri Jun 01, 2018 4:24 pm

Can you be a bit more specific about what you are doing? What values in AA need to be copied? Is it the value for one date, or values for a range of dates? Are we matching up observations by-date?

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Re: Copy values from cross-section to entire vector

Postby stefanp » Mon Jun 04, 2018 2:26 am

I have created a workfile and a codefile which does the required task. However, I assume this approach is way too complicated for what I require.
Attachments
example.wf1
(12.29 KiB) Downloaded 264 times
example.prg
(275 Bytes) Downloaded 271 times

EViews Glenn
EViews Developer
Posts: 2671
Joined: Wed Oct 15, 2008 9:17 am

Re: Copy values from cross-section to entire vector

Postby EViews Glenn » Mon Jun 04, 2018 6:27 pm

Code: Select all

series var2a = @meansby(var2, country, date)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 12 guests