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
How to obtain cross section with max/min value of a series in a panel data set?
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
Re: How to obtain cross section with max/min value of a series in a panel data set?
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
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)
Who is online
Users browsing this forum: No registered users and 12 guests