@ifirst and @ilast with panel data - how to obtain the respective @crossid

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

mamo
Posts: 189
Joined: Wed Nov 07, 2012 9:11 am

@ifirst and @ilast with panel data - how to obtain the respective @crossid

Postby mamo » Mon Jun 25, 2018 5:21 am

Dear Eviews team,

I use Eviews 10, Mar 2018 build,

Assume x being series in a panel data workfile
@ifirst(x) or @ilast(x) give the @cellid associated with the of the first or last non-missing value of x
Is there a way to obtain also the respective @crossid ?

Best,
mamo

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

Re: @ifirst and @ilast with panel data - how to obtain the respective @crossid

Postby EViews Gareth » Mon Jun 25, 2018 7:13 am

I don't believe there is in one line.
Follow us on Twitter @IHSEViews

EViews Matt
EViews Developer
Posts: 557
Joined: Thu Apr 25, 2013 7:48 pm

Re: @ifirst and @ilast with panel data - how to obtain the respective @crossid

Postby EViews Matt » Mon Jun 25, 2018 9:07 am

I believe the long way around is something like,

Code: Select all

series tmp = @crossid
scalar ci = tmp(@ifirst(x))

mamo
Posts: 189
Joined: Wed Nov 07, 2012 9:11 am

Re: @ifirst and @ilast with panel data - how to obtain the respective @crossid

Postby mamo » Mon Jun 25, 2018 9:43 am

This works, many thanks;
btw, @ifirst(x) provides the @obsid - not the @crossid as I wrote - associated with the of the first or last non-missing value of x.

Code: Select all

scalar obsid = @ifirst(x)

series tmp=@crossid
scalar crossid = tmp(@ifirst(x))

series tmp=@cellid
scalar cellid = tmp(@ifirst(x))

Best,
mamo


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 13 guests