How to obtain cross section with max/min value of a series in 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 Jason, EViews Steve, EViews Moderator

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

How to obtain cross section with max/min value of a series in a panel data set?

Postby mamo » Mon Feb 03, 2020 4:26 am

Dear Eviewers,

in a panel data work page, is there a simple approach to obtain the cross-section for which the value of a series takes a maximum (or minimum) across all cross-sections at a given date, or within a given sub-sample?

Best, Mamo

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

Re: How to obtain cross section with max/min value of a series in a panel data set?

Postby mamo » Mon Feb 03, 2020 6:19 am

I have found myself one solution to pick up the respective @crossids at each date which works as long as @maxsby(x, @date)/ @minby(x, @date) provide unique values (otherwise, only the first @crossid will be provided).
Any other suggestions are much welcome
Best, mamo

Code: Select all

' Show for each date @crossed for which series x is max
smpl @all if @maxsby(x, @date)=x
group gr @date @crossid
gr.sort(@date, @crossid)
show gr
' Alternatively: generate series indicating the @crossid which takes the max/min value of x in the respective date.
' indicator=(@maxsby(x, @date)=x)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 14 guests