Page 1 of 1

Assign Value to a series pooled cross-section

Posted: Fri Jun 24, 2016 5:38 am
by stefanp
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.

Re: Assign Value to a series pooled cross-section

Posted: Fri Jun 24, 2016 6:26 am
by EViews Gareth
Panel or pool?

Re: Assign Value to a series pooled cross-section

Posted: Wed Jun 29, 2016 2:36 am
by stefanp
Dated Panel

Re: Assign Value to a series pooled cross-section

Posted: Wed Jun 29, 2016 8:02 am
by EViews Gareth
If the other cross-sections currently have no data (i.e. are NA), then you could do:

Code: Select all

x= @maxsby(x, @date)

Re: Assign Value to a series pooled cross-section

Posted: Thu Jun 30, 2016 4:31 am
by stefanp
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.

Re: Assign Value to a series pooled cross-section

Posted: Thu Jun 30, 2016 6:51 am
by EViews Gareth
Same reason I used max