Is there an @elem() commmand for panel data?

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

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

Is there an @elem() commmand for panel data?

Postby ech447 on Wed Jul 28, 2010 10:09 am

Is there an @elem() commmand for panel data? Something like @elem(PX, * - 2006) that would return the 2006 value of PX for the UK when the computations were for the UK (one of the panel cross-sections) but use the 2006 value of PX for Spain (another) when the computations are for Spain? I use EViews 7.1, latest update. Thanks.
ech447
 
Posts: 5
Joined: Tue Jul 13, 2010 3:23 pm

Re: Is there an @elem() commmand for panel data?

Postby EViews Gareth on Wed Jul 28, 2010 10:23 am

No, although you can always set the sample equal to the observation you want, and then take the maximum of the series (the max of a single number is just that number):
Code: Select all
smpl 2006 2006 if country = "UK"
!value = @max(px)
EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
 
Posts: 1903
Joined: Tue Sep 16, 2008 5:38 pm

Re: Is there an @elem() commmand for panel data?

Postby ech447 on Thu Jul 29, 2010 7:21 am

Thanks.
In terms of future EViews development, it would be useful to have such a command. Not infrequently we want to use indexes formed by, say, taking PX/@elem(PX,2002) for a standard time series. For panel data, I switch to a spreadsheet program for my computations. It would be nice to be able to just stay in EViews.
ech447
 
Posts: 5
Joined: Tue Jul 13, 2010 3:23 pm

Re: Is there an @elem() commmand for panel data?

Postby EViews Glenn on Thu Jul 29, 2010 9:34 am

Thanks for the suggestion. A couple of things.

First, your proposed syntax is interesting. One issue is that one could conceivably want the alternate definition of your @elem in which we return the cross-section value for the given year, as in

PX/@elem(PX,"UK")

That's all fine, but now the issue comes as to how to disambiguate the two approaches. One idea is to use @elem in the fashion that you suggested, and to add an @elemc or some other such function which returns the others. We'll give this some more thought.

One of the reasons we haven't added the particular function is that most things that we can think of can be done with little effort using current EViews tools. Note that you can (relatively) easily generate your indices in EViews. Expanding on Gareth's suggestion, first, you need to generate a series which has the 1996 values for each cross-section matched to each observation in a cross section. Once you have that, you can compute your index in the natural way:
Code: Select all
series pxscale = @maxsby(PX, @crossid, "1996 1996")
series PX1 = PX / pxscale

You can combine this into a single statement if you'd like
Code: Select all
series PX1 = PX / @maxsby(PX, @crossid, "1996 1996")

You can wrap this in a subroutine if you wish, and even design an add-in to handle the front end input so that all you'd have to enter is the series name and the year/date.

Hope this helps. Thanks again for the suggestion.
EViews Glenn
EViews Developer
 
Posts: 479
Joined: Wed Oct 15, 2008 9:17 am


Return to Data Manipulation

Who is online

Users browsing this forum: lallaar, Yahoo [Bot] and 1 guest