I'm relatively new to EViews.
I have a panel containing a numerical data for each (Country x Date).
I would like to create a series that would contain, for each (Country x Date) pair the country's rank compared to other countries at the specified date.
How can I do this?
TDB
Ranking in panel data
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Ranking in panel data
Code: Select all
series temp = @obsid
!timepers = @max(temp)
for !i=1 to !timepers
smpl @first @first+!i-1
series ranks = @ranks(Y)
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Ranking in panel data
Slight typo. Should be:
Code: Select all
series temp = @obsid
!timepers = @max(temp)
for !i=1 to !timepers
smpl @first+!i-1 @first+!i-1
series ranks = @ranks(Y)
next
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Ranking in panel data
This version is robust to unbalanced panels:
Code: Select all
series temp = @trendc
!time = @max(temp)
for !i=0 to !time
smpl if @trendc = !i
series ranks = @ranks(Y)
next
smpl @all
Who is online
Users browsing this forum: No registered users and 2 guests
