Hi,
I'm using Eviews 8.
I would like to create a bar graph with the last observation of 40 variables, but arranging the data values from maximum value to minimum value.
In addition, I would like the graph update itself with the new data each quarter and variable names to be linked to the observations of my bar graph.
What's the best way to accomplish this?
Thanks
Sorting last data of a group variables
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: Sorting last data of a group variables
Set the sample to be the last observation, then convert the group into a vector (stom command), sort the vector (@sort), then make bar chart out of the vector.
There is no way to make it auto-update though. You'd have to re-run the .prg
There is no way to make it auto-update though. You'd have to re-run the .prg
Re: Sorting last data of a group variables
Hi,
Thanks for the quick answer.
I did what you recommended, but this method does not match the variable names with the observations in the bar chart.
Is it possible to do so?
Thanks
Thanks for the quick answer.
I did what you recommended, but this method does not match the variable names with the observations in the bar chart.
Is it possible to do so?
Thanks
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Sorting last data of a group variables
No, but here's a more complicated method:
Code: Select all
'make some data
create u 10
for !i=1 to 5
series x!i=nrnd
next
group g x*
'make the graph.
smpl @last @last
stom(g, myvec)
vector ranks = @ranks(myvec)
%names = g.@members
group g2
for !i=g.count to 1 step -1
for !j=1 to g.@count
if ranks(!j)=!i then
%name = @word(%names, !j)
g2.add {%name}
endif
next
next
show g2.bar
Who is online
Users browsing this forum: No registered users and 1 guest
