How to select one entity's time series from a panel data set

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

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

Steve06
Posts: 19
Joined: Fri Apr 29, 2011 2:51 pm

Re: How to select one entity's time series from a panel data

Postby Steve06 » Sun May 01, 2011 8:28 pm

thanks, your continuous support is highly appreciated.
it works provided you have no sample restriction before running these lines (i.e. had to do "smpl @all" before)
now, inside my loop

Code: Select all

for !i=1 to !ncross smpl if @crossid = !i 'do something here next
how can i obtain the current id value (the real one) being processed?
!id=@crossid throws the same error as the one before

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

Re: How to select one entity's time series from a panel data

Postby EViews Gareth » Sun May 01, 2011 8:40 pm

!i

Steve06
Posts: 19
Joined: Fri Apr 29, 2011 2:51 pm

Re: How to select one entity's time series from a panel data

Postby Steve06 » Sun May 01, 2011 8:54 pm

!i would just return the current level of the counter !i (e.g. 1 through 500)
but my id values are non-sequential and do not start at 1, e.g. 1001, 1005, 1016...
these are the ones i'd like to retrieve

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: How to select one entity's time series from a panel data

Postby startz » Sun May 01, 2011 9:10 pm

Remember that once you've smpl if to pick a cross-section, then you've selected the sample for all the variables. So if you have a variable named cross_section_name_or_whatever,

Code: Select all

for !i=1 to !numcross smpl if @crossid = !i show cross_section_name_or_whatever next

Steve06
Posts: 19
Joined: Fri Apr 29, 2011 2:51 pm

Re: How to select one entity's time series from a panel data

Postby Steve06 » Sun May 01, 2011 9:26 pm

ok, but i need the current value to be stuffed into a temporary variable !current_id_value ...
let's say my identifier variable is called myid
myid(xxx) does not do the job since the reference inside the brackets is relative to the whole range, not the current sample, otherwise it would be straightforward to just have !current_id_value=myid(1), but this obviously doesn't work

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: How to select one entity's time series from a panel data

Postby startz » Mon May 02, 2011 6:53 am

Try @first(myid)

Steve06
Posts: 19
Joined: Fri Apr 29, 2011 2:51 pm

Re: How to select one entity's time series from a panel data

Postby Steve06 » Mon May 02, 2011 9:15 am

yes, this seems to work! problem resolved. thank you.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests