Page 1 of 1

Function @elem() for panel data.

Posted: Fri Feb 22, 2013 3:21 am
by huugh
Hi,
if working with panel data, I would like to transform a series to index, with value of one year as a base.

Assuming a panel with T=20 observations (dated from 1991 to 2010), and K=30 cross-sections, and I would like to use the value of T=15, to generate something like this:

Code: Select all

series index1= 100*series1/@elem(series1, 15)
So, how should I address the elements of series in panel data workfile?


(even if I limit my sample to one crossid, and try to generate

Code: Select all

scalar abc =@elem(series1, 15)
or

Code: Select all

scalar abc =@elem(series1, "2005")
, it says "Date does not uniquely define observations in panels"... - which is indeed true, so how should I address the observations uniquely?)

Re: Function @elem() for panel data.

Posted: Fri Feb 22, 2013 10:56 am
by EViews Glenn
If I correctly understand what you are trying to do, I think this will work

Code: Select all

series index1= 100*series1/@sumsby(series1, id, "2005 2005")
where ID is your cross-section identifier. The @sumsby takes the sum for each ID for the specified sample and repeats that for all observations in the workfile. So each SERIES1 value is rebased relative to the within cross-section value in 2005.