## @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: 106
Joined: Wed Nov 07, 2012 9:11 am

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

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: 11875
Joined: Tue Sep 16, 2008 5:38 pm

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

I don't believe there is in one line.

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

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

I believe the long way around is something like,

Code: Select all

`series tmp = @crossidscalar ci = tmp(@ifirst(x))`

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

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

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=@crossidscalar crossid = tmp(@ifirst(x))series tmp=@cellidscalar cellid = tmp(@ifirst(x))`

Best,
mamo