Assign Value to a series pooled cross-section

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

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

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

Assign Value to a series pooled cross-section

Postby stefanp » Fri Jun 24, 2016 5:38 am

I would like to assign values from a particular cross-section to all cross-sections.

Let me illustrate the problem with an example:
Suppose my sample consists of 10 periods, x cross-sections and two series ("series_a" and "series_b")

Now "series_b" (each cross section) should be equal to "series_a" (cross section "A")

It's not difficult to write a mini program to achieve that, e.g.

Code: Select all

For !i=0 To 10 smpl @first+(!i) @first+(!i) if ident="A" !temp=@max(series_a) smpl @first+(!i) @first+(!i) series_b=!temp Next
However, I would have guessed that there is a more elegant way.

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

Re: Assign Value to a series pooled cross-section

Postby EViews Gareth » Fri Jun 24, 2016 6:26 am

Panel or pool?

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

Re: Assign Value to a series pooled cross-section

Postby stefanp » Wed Jun 29, 2016 2:36 am

Dated Panel

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

Re: Assign Value to a series pooled cross-section

Postby EViews Gareth » Wed Jun 29, 2016 8:02 am

If the other cross-sections currently have no data (i.e. are NA), then you could do:

Code: Select all

x= @maxsby(x, @date)

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

Re: Assign Value to a series pooled cross-section

Postby stefanp » Thu Jun 30, 2016 4:31 am

It's not the maximum value of the series. It's just a workaround in my code to assign a single value from a vector to s scalar. Clearly, due to the smpl command the vector is restricted to one value.

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

Re: Assign Value to a series pooled cross-section

Postby EViews Gareth » Thu Jun 30, 2016 6:51 am

Same reason I used max


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests